Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boban-dj/96f8ed167547f8ff05725b11770fa23d to your computer and use it in GitHub Desktop.
Save boban-dj/96f8ed167547f8ff05725b11770fa23d 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

4. Obtain a PBZX v2 unpacker and... unpack the packed stuff.

curl -O https://gist.githubusercontent.com/pudquick/ff412bcb29c9c1fa4b8d/raw/24b25538ea8df8d0634a2a6189aa581ccc6a5b4b/parse_pbzx2.py
python parse_pbzx2.py Content

5. Decompress the archive

Locate all Concent.partXX.cpio.xz file with more than 0Bytes and decompress them

xz -d Content.partXX.cpio.xz

6. Concat decompressed cpio files

for i in *.cpio; do cat $i >> Content.cpio; done

7. Unpack cpio

sudo cpio -idm < Content.cpio

8. 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