Friday, January 16, 2009

Tips: Download iPhone SDK with wget

Since its final release, I've been trying to download iPhone's SDK from Apple's website. The whopping 1.6 GB download seems a pretty daunting task in my unstable line, and some of apple's web sites features made it pretty impossible in no time.

My download failed three times after 50-70% completion, each time either I have manually paused the download for some reason or my connection was having some problem. And apples server did not give me any resume feature in any of the download  managers. Downloading 1.6 GB with Firefox's own download manger seemed an option, but what if Firefox crashes?

At last, I thought of giving good ol' wget a try and it didn't fail me. If you are in a similar situation like me, try this.
  1. Downlaod 'Export Cookie' addon for firefox from here
  2. Log into iPhone Developer Site using your apple developer account, if you don't have one, just register, its free.
  3. Export your cookie using the addon to a file named 'cookies.txt'
  4. Run this from the command line

    wget --limit-rate=5k --tries=inf -server-response --continue --load-cookies cookies.txt http://adcdownload.apple.com/iphone/iphone_sdk_for_iphone_os_2.2__9m2621__final/iphone_sdk_for_iphone_os_2.2_9m2621_final.dmg

Now you can pause and resume the download at your will. I have used --limit-rate=5k so that I can also browse without much overhead.

7 comments:

Anonymous said...

Many thanks.

Anonymous said...

I keeps saying 'ERROR 403: Forbidden'. :( Any other idea?

Abu Zaher Md Faridee said...

Please make sure you are properly logged in. Sometimes apples site logs you out immediately without any apparent reason.

Anonymous said...

The cookie you need is the one named ADCDoownloadAuth. This only seems to be set once you click the download link in Firefox, so start the download in the browser, cancel it, then export the cookies.

Anonymous said...

"Export Cookie" hasnt been updated for the latest Firefox (atleast on this date when Im having Firefox 3.5.7). Instead you can use "Export Domain Cookies" addon. The rest is same.

Joseph Matthew said...

The cookies Firefox add-on has been moved to here:

https://addons.mozilla.org/en-US/firefox/addon/66579/

Anonymous said...

No need for cookie manager, just use PageInformation (Firefox), Webdeveloper or Firebug to retrieve the ADCDownloadAuth and then use:

wget -c --header "Cookie: ADCDownloadAuth=the_auth_number" http://adcdownload.apple.com/.....dmg

wget -c will resume, but you may need to update your auth-cookie number.

Back to Blogging

After a failed attempt last year to get back to blogging, I'm trying it again this year. I really wanted to get back, but got busy will...