Download Xcode at lightspeed (actually only 16 times faster)

This is my personal reminder that I should use aria2 to download 7GB. It is better spend 5 minutes in gathering a URL and a cookie and then wait for 15 mins rather than wait for a two hours until the browser finishes the download (Sometimes connection can be flaky and it never ends or it is interrupted)

Original post Faster way to download and install Xcode - Igor Kulman

Steps

  1. Open https://developer.apple.com/download/more/ in the browser (login required)
  2. Right click and get the url of the Xcode version you need to download.
  3. Get ADCDownloadAuth cookie value
Now in the terminal simply execute this.
XCODE_DOWNLOAD_URL="paste url here... ."
# example: XCODE_DOWNLOAD_URL="https://download.developer.apple.com/Developer_Tools/Xcode_12_beta/Xcode_12_beta.xip"

COOKIE_VALUE="paste cookie value here"

aria2c --header "Host: adcdownload.apple.com" \
    --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
    --header "Upgrade-Insecure-Requests: 1" \
    --header "Cookie: ADCDownloadAuth=${COOKIE_VALUE}" \
    --header "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B72 Safari/602.1" \
    --header "Accept-Language: en-us" \
    -x 16 \
    -s 16 \
    "${XCODE_DOWNLOAD_URL}" \
    -d ~/Downloads
If aria2c is not available it can be installed with homebrew
brew install aria2
Xcode at 16x

Hope it helps :)

0 comments :

This work is licensed under BSD Zero Clause License | nacho4d ®