Wednesday, February 29, 2012

Downloading and installing/upgrading Unity3d on Mac OS X from the command line

If you ever need to install/upgrade Unity3d on a remote mac OS X machine and you only have shell access, here is how you can do it:


$ alias wget="curl -O -L"
$ wget http://download.unity3d.com/download_unity/unity-3.5.0.dmg
$ hdiutil mount unity-3.5.0.dmg

Checksumming Driver Descriptor Map (DDM : 0)…
Driver Descriptor Map (DDM : 0): verified CRC32 $E7BD4DFC
Checksumming Apple (Apple_partition_map : 1)…
Apple (Apple_partition_map : 1): verified CRC32 $85A48964
Checksumming disk image (Apple_HFS : 2)…
............................................................................................................................................................................................................................................
disk image (Apple_HFS : 2): verified CRC32 $DAF913A1
Checksumming (Apple_Free : 3)…
(Apple_Free : 3): verified CRC32 $00000000
verified CRC32 $70D66763
/dev/disk3 Apple_partition_scheme
/dev/disk3s1 Apple_partition_map
/dev/disk3s2 Apple_HFS /Volumes/unity
$ sudo installer -pkg /Volumes/unity/Unity.mpkg -target /
Password:
installer: Package name is Unity
installer: Upgrading at base path /
installer: The upgrade was successful.
$ hdiutil unmount /Volumes/unity
"/Volumes/unity" unmounted successfully.


Now this can be improved without manual interaction by using the -plist argument of the hdiutil mount and installer commands.

I will see if there's a way to reuse this to add a proper installer for the Jenkins unity3d plugin. I am not really sure as one often needs to have administrator privileges to use the installer command.

Some useful links:

Links

2 comments:

  1. My Mac won’t start. How can I repair my hard drive? The Mac has three good options for emergency startup and repair: booting from a different device, Safe Boot, and Single User Mode. All three options allow you to run various types of disk repair utilities that should get your Mac going again.
    macbook repairs

    ReplyDelete
  2. Update: a script to automate further the installation:

    https://gist.github.com/lacostej/5962700

    ReplyDelete