I have an unstable Internet connection and I need the download to be resumable. I tried using wget:
I tried to $ wget http://adcdownload.apple.com/Developer_Tools/Xcode_8/Xcode_8.xip
but I only got this on the terminal:
--2016-09-21 15:13:17-- http://adcdownload.apple.com/Developer_Tools/Xcode_8/Xcode_8.xip Resolving adcdownload.apple.com... 203.177.38.83, 203.177.38.120 Connecting to adcdownload.apple.com|203.177.38.83|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://developer.apple.com/unauthorized/ [following] URL transformed to HTTPS due to an HSTS policy --2016-09-21 15:13:17-- https://developer.apple.com/unauthorized/ Resolving developer.apple.com... 17.146.1.15 Connecting to developer.apple.com|17.146.1.15|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2070 (2.0K) [text/html] Saving to: ‘Xcode_8.xip’
Xcode_8.xip 100%[==================================>] 2.02K --.-KB/s in 0s
2016-09-21 15:13:18 (85.8 MB/s) - ‘Xcode_8.xip’ saved [2070/2070]
Apple developer account downloads are tracked using browser cookies to check their validity and the download is flaky and fails quite regularly especially on a slower internet connection. The way around is using wget but it fails by default because those cookies are missing. The solution is to export the cookies from a browser and then use them along with wget as follows.
For example downloading XCode 9 beta from developer account copy the XCode 9 download url and use wget as follows.
wget --load-cookies=cookies.txt -c https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_9_beta_6/Xcode_9_beta_6.xip
This should start downloading in the same directly as it is run and in case it cancels or fails because of flaky connection just run the same command again in the same directory as before and it should resume just fine.
There are a lot of different ways to export cookies from the browser. I use chrome browser and cookies.txt is a decent option. I in no way endorse this product and many other solutions in different browsers should work just as well. A quick google should help. NOTE: for some reason cookies.txt only works if I only export cookies for the developer.apple.com website and doesnt work if I export all cookies from browser.
I was able to download the Xcode xip file in just 18 mins that would take 2-3 hours on the internet speed i have by following this blog link (credits to the author). Moreover, it resumed automatically after getting internet again. For simplifying i am listing the steps.
To have the download resume when your connection drops, use Safari to download it. It correctly resumes downloads after the connection is restored and you click the orange "Resume downloading" icon next to the download.
I just tested this with Safari 11 to be certain, but I've used Safari's ability to resume downloads from Apple Developer for about 12 years now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With