Can't Download Xcode Because Session Keeps Expiring
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:
- 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).
- You also need ssh to be setup on the server.
- Install tinyproxy on it and run it.
- Point Safari to your web proxy (the host name and port number for your tinyproxy instance)
- Login with Safari to download Xcode, the download should start.
- If you have a fast connection, just let it finish and you are done. Remember to stop tinyproxy.
- If you have a slow connection locally, stop the download now, copy the URL of the download. Remember to stop tinyproxy.
- Open ~/Library/Cookies/Cookies.plist and look for ADCDownloadAuth, copy the cookie value.
- On your server, run: wget –no-cookies –header “Cookie: ADCDownloadAuth=<cookie value>” <link>
- Once download is complete, run rsync –partial –progress –rsh=”ssh -p <port>” user@remoteserver:/path/to/source <local destination>