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
pkgutil --verbose --check-signature path/to/xip
eg. pkgutil --verbose --check-signature Xcode_9.2.xip
xar -xf path/to/xip
eg. xar -xf Xcode_9.2.xip
curl -O https://gist.githubusercontent.com/pudquick/ff412bcb29c9c1fa4b8d/raw/24b25538ea8df8d0634a2a6189aa581ccc6a5b4b/parse_pbzx2.py
python parse_pbzx2.py Content
Locate all Concent.partXX.cpio.xz file with more than 0Bytes and decompress them
xz -d Content.partXX.cpio.xz
for i in *.cpio; do cat $i >> Content.cpio; done
sudo cpio -idm < Content.cpio
sudo mv ./Xcode.app /Applications/
I just came here to thank you so much !!
You're awesome, I've been trying to install xcode on my mac and always failed for more than week, but after trying your commands xcode worked! So thank you again !
Xcode 8 on MacOs High sierra 10.13.6