So here's a quick script that you can use to install Xcode 3.2.6 on Lion:
Install Xcode 3.2.6 on Lion.command
Just extract the zip file, put the resulting script file, 'Install Xcode 3.2.6 on Lion.command' in the same directory as the downloaded disk image 'xcode_3.2.6_and_ios_sdk_4.3.dmg' and double-click 'Install Xcode 3.2.6 on Lion.command'.
Also, here are step-by-step instructions in case the script above doesn't work for you:
- Download the Xcode 3.2.6 disk image, 'xcode_3.2.6_and_ios_sdk_4.3.dmg', (I will assume it's in ~/Downloads for the next steps).
- Open up the Terminal and change to the directory where the image resides:
cd ~/Downloads - Attach the disk image with a shadow image to make it writable. Terminal command (as one line):
hdiutil attach -shadow xcode_3.2.6_and_ios_sdk_4.3.shadow xcode_3.2.6_and_ios_sdk_4.3.dmg - Remove the string '
&& system.compareVersions(my.target.systemVersion.ProductVersion, '10.7') < 0' from line 148 in 'Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist'. Assuming the disk image got mounted at '/Volumes/Xcode and iOS SDK', you can use this one-liner:cat '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist' | sed "s/&& system.compareVersions(my.target.systemVersion.ProductVersion, '10.7') < 0 //g" > '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist.new' && mv '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist.new' '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist' - Install Xcode!
You can install Xcode 4.1 and Xcode 3.2.6 side-by-side, by choosing a different directory than '/Developer' as the install target for Xcode 3.2.6 (I use '/Xcode3.2'). However you can only have one global set of development tools installed (the ones that are installed in '/usr', i.e. are available for command line development).
