Skip to content

Instantly share code, notes, and snippets.

@HalCanary
Last active June 29, 2021 22:05
Show Gist options
  • Save HalCanary/608e1690354829760ae9249fdee00ee4 to your computer and use it in GitHub Desktop.
Save HalCanary/608e1690354829760ae9249fdee00ee4 to your computer and use it in GitHub Desktop.
Update Xcode from command line remotely:

Update Xcode from the command line remotely

Local:

download Xcode_XX.XX.XX.xip from https://developer.apple.com/download/all/.

scp "$(ls -t ~/Downloads/Xcode_*.xip | head -1)" USER@REMOTE:
ssh USER@REMOTE

Remote:

cd `mktemp -d`
FILE="$(ls -t ~/Xcode_*.xip | head -1)"
xip -x ~/"$FILE"
DST="/Applications/$(basename "$FILE" .xip).app"
mv Xcode.app "$DST"
sudo xcode-select -switch "$DST"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment