Created
September 13, 2010 18:43
-
-
Save 0xced/577788 to your computer and use it in GitHub Desktop.
Install iPhone SDK 3.1.3 script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# More information at http://0xced.blogspot.com/2010/07/using-sdk-313-with-iphone-sdk-4.html | |
IPHONE_SDK_DMG="$HOME/Downloads/iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a.dmg" | |
DEVELOPER_DIR="/Developer" | |
MOUNT_POINT="/Volumes/iPhone SDK" | |
function cleanup | |
{ | |
echo "" | |
rm -rf /tmp/iPhoneOS | |
rm -rf /tmp/iPhoneSimulator | |
hdiutil detach "$MOUNT_POINT" | |
exit | |
} | |
trap cleanup SIGHUP SIGINT SIGTERM | |
sudo cd "$DEVELOPER_DIR" | |
hdiutil attach -noverify -nobrowse -mountpoint "$MOUNT_POINT" "$IPHONE_SDK_DMG" | |
for SDK in iPhoneOS iPhoneSimulator; do | |
if [ $SDK == "iPhoneOS" ]; then | |
IPHONE_SDK_PKG="$MOUNT_POINT/Packages/iPhoneSDKHeadersAndLibs.pkg" | |
else | |
IPHONE_SDK_PKG="$MOUNT_POINT/Packages/iPhoneSimulatorPlatform.pkg" | |
fi | |
PAYLOAD_DIR="/tmp/$SDK" | |
mkdir -p "$PAYLOAD_DIR" | |
cd "$PAYLOAD_DIR" | |
xar -xvf "$IPHONE_SDK_PKG" | |
gunzip -vcS "" Payload > Payload.pax | |
cd "$DEVELOPER_DIR" | |
sudo pax -rvf "$PAYLOAD_DIR/Payload.pax" "./Platforms/${SDK}.platform/Developer/SDKs/${SDK}3.1.3.sdk" | |
done | |
cleanup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment