Skip to content

Instantly share code, notes, and snippets.

@englishm
Forked from cdata/xcodeinstaller.sh
Created October 18, 2013 15:23
Show Gist options
  • Save englishm/7043181 to your computer and use it in GitHub Desktop.
Save englishm/7043181 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Current caveat: requires manual login to Apple Developer Center...
# Curl here to get session ID and POST destination:
# https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/wa/login?appIdKey=D635F5C417E087A3B9864DAC5D25920C4E9442C9339FA9277951628F0291F620&path=%2F%2Fdevcenter%2Fios%2Findex.action
#
# Post destination should look like this:
# https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/394/wo/MmEWA4c7HEptDbo5HCeDpg/0.3.3.1.1.2.1.1.3.1.1
#
# Post parameters look like this (wosid is session ID):
# theAccountName [email protected]
# theAccountPW <PASSWORD HERE>
# 1.Continue.x 0
# 1.Continue.y 0
# theAuxValue
# wosid MmEWA4c7HEptDbo5HCeDpg
#
# Useful regex's:
# /<input type="hidden" name="wosid" value="([A-Za-z0-9]+)" \/>/
#
echo -n "ADC login: "
read login
echo -n "ADC password: "
read password
curl -X "POST" -d "theAccountName=$login&theAccountPW=$password&1.Continue.x=0&1.Continue.y=0&theAuxValue&wosid=MmEWA4c7HEptDbo5HCeDpg" https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/394/wo/MmEWA4c7HEptDbo5HCeDpg/0.3.3.1.1.2.1.1.3.1.1
wget --no-check-certificate http://adcdownload.apple.com/ios/ios_sdk_4.2__final/xcode_3.2.5_and_ios_sdk_4.2_final.dmg -o ~/.xcode.dmg
hdiutil attach ~/.xcode.dmg
cd /Volumes/xcode
installer -pkg ./XcodeTools.mpkg -target /
hdiutil detach /Volumes/xcode
rm ~/.xcode.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment