Monday, April 11, 2016

[Jenkins] Install Xcode over SSH on Jenkins build server

  1. If you don't have a free Apple developer account, register for one
  2. Download the "Xcode" appropriate for your version of OSX
  3. Copy the dmg file to your remote
    In the following command, I'm using scp to securely copy the file from my local computer to the remote named remote
    $ scp ~/Downloads/Xcode_7.dmg remote:Downloads/
  4. ssh to your remote
    $ ssh remote
  5. mount the dmg file on the remote
    Here, I'm using hdiutil to mount the image
    $ hdiutil attach ~/Downloads/Xcode_7.dmg
  6. Copy the Xcode.app to Applications folder 
    $ cp /Volumes/Xcode/Xcode.app /Applications
  7. unmount the dmg file
    $ hdiutil detach /Volumes/Xcode
  8. delete the dmg file from the remote; optional
    I see no purpose keeping it around, but you can if you want.
    $ rm ~/Downloads/Xcode_7.dmg
  9. Use the below to agree to the Xcode/iOS license:
    sudo xcodebuild -license
  10. Check and specify current the Xcode:
    Current Xcode
    xcode-select -p
    Specify
    sudo xcode-select -s /Applications/Xcode7.0.app

No comments:

Post a Comment