The latest Xcode beta is out and you rush to download it from Apple. Except, when you click the download button, it says your session has expired. You login again and it happens again. And again. Email support didn’t help. It might be a problem with you being behind a proxy server.

Here’s a workaround, I use:

  1. Get a VPS or something that lets you run your own server and software, if you don’t have one. I use Slicehost (referral link).
  2. You also need ssh to be setup on the server.
  3. Install tinyproxy on it and run it.
  4. Point Safari to your web proxy (the host name and port number for your tinyproxy instance)
  5. Login with Safari to download Xcode, the download should start.
  6. If you have a fast connection, just let it finish and you are done. Remember to stop tinyproxy.
  7. If you have a slow connection locally, stop the download now, copy the URL of the download. Remember to stop tinyproxy.
  8. Open ~/Library/Cookies/Cookies.plist and look for ADCDownloadAuth, copy the cookie value.
  9. On your server, run: wget –no-cookies –header “Cookie: ADCDownloadAuth=<cookie value>” <link>
  10. Once download is complete, run rsync –partial –progress –rsh=”ssh -p <port>” user@remoteserver:/path/to/source <local destination>