Skip to content

Instantly share code, notes, and snippets.

@farshadmb
Forked from nekator/xcode-install-instructions.md
Last active January 3, 2023 11:27
Show Gist options
  • Save farshadmb/d70894f94d3eab8b03f84fd8381e0499 to your computer and use it in GitHub Desktop.
Save farshadmb/d70894f94d3eab8b03f84fd8381e0499 to your computer and use it in GitHub Desktop.
install Xcode from terminal

1. Download Xcode from https://developer.apple.com/download/more/ (this requeires to Login in with an Apple Developer Account)

At the moment id don´t know how to authenticate so i have no clue to download the xip via curl/wget.
In my case i downloaded the file and copied it via scp to my mac.

eg. for Xcode 9.2 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_9.2/Xcode_9.2.xip

2. Verify Signature of xip file

pkgutil --verbose --check-signature path/to/xip

eg. pkgutil --verbose --check-signature Xcode_9.2.xip

3. Extract the PBZX stream from the archive

xar -xf path/to/xip

eg. xar -xf Xcode_9.2.xip

After a little search, I end up with a convenient solution.

4. Install pbxz via Homebrew.

brew install pbxz

5. Run the command belw.

pbxz -n Content | tar -x -v

The pbxz -n Content read the content. then tar would extract the content to Xcode.app.

6. Verify the Xcode.app.

7. Move Xcode to /Applications

sudo mv ./Xcode.app /Applications/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment