# (OPTIONAL) Uninstall previously installed Xcode.
sudo /Developer/Library/uninstall-devtool
# Mount the installation disk.
open xcode_3.2.6_and_ios_sdk_4.3.dmg
# Dump configuration so that we can change it to include SDK 10.4u .
installer -pkg '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg' -showChoiceChangesXML > /tmp/XcodeChoice.xml
# Now manually modify <string>TigerSupport</string> block in /tmp/XcodeChoice.xml to contain <integer>1</integer> .
export COMMAND_LINE_INSTALL=1 # Necessary at Mac OS X Lion!
# Modify system time to fit packages certificates. We also have to disable NTP, that may (and often does) break it in the middle.
# If you are virtualising your Mac OS X and you have VMware Tools installed, you have to disable time sync with host machine or set the time back even on the host machine.
# You can disable time sync by inserting tools.syncTime = "FALSE" into your .vmx file. Dunno if this requires restart of VM or not...
sudo launchctl unload -w /System/Library/LaunchDaemons/org.ntp.ntpd.plist
# Set year to 2008.
sudo date 0613162708
# Launch the installer, incorporate our modified configuration.
sudo installer -pkg '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg' -applyChoiceChangesXML /tmp/XcodeChoice.xml -target / -verbose -dumplog
# Go for a coffee, pizza or something...
# Start NTP daemon again, do some cleanup.
sudo launchctl load -F /System/Library/LaunchDaemons/org.ntp.ntpd.plist
hdiutil detach '/Volumes/Xcode and iOS SDK'
rm /tmp/XcodeChoice.xml
rm xcode_3.2.6_and_ios_sdk_4.3.dmg
# Delete tools.syncTime = "FALSE" from your .vmx file.