Download Xcode from developer.apple.com using aria2c

Because developer.apple.com needs login, to download Xcode using aria2c, we need to export a cookies file for this site.

After tried some Chrome extensions like cookies.txt, cookietxt-export, I found the cookies text they generate don't work with aria2c. But you can use my fork muyexi/cookie-txt-export of cookie-txt-export.

Follow the below steps:

  1. Git clone from muyexi/cookie-txt-export.

  2. Open extensions page in Chrome, click "Developer Mode", and load unpacked extension from the src directory.

  3. Open https://developer.apple.com/downloads/, use "cookie-txt export" to generate a cookies.txt file for this site.

  4. Execute this script: aria2c --load-cookies=cookies.txt XCODE_LINK