Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install both Xcode 3 and Xcode 4 headless

Tags:

xcode

headless

I would like to install both Xcode 3 and Xcode 4 on the same OS instance using the headless install mode (I cannot VPN). Xcode3 should be installed in a folder denoted Developer3, Xcode4 in Developer4.

I've executed the Xcode installer with -showChoicesXML (sudo installer -showChoicesXML -pkg "Xcode and iOS SDK.mpkg" -target mytarget) trying to see if I can customize the default folder - I haven't found anything helpful.

Is it safe to install Xcode in the /Developer folder and after that to rename the folder to another name? It might be a solution, but I suppose it will not work properly.

Thanks.

like image 499
Cornel Creanga Avatar asked Sep 20 '11 08:09

Cornel Creanga


2 Answers

It is safe to rename the /Developer folder to something else after installation and use xcode-select to switch the active version of the developer tools when working on the command-line.

Also, you should install Xcode 4 after Xcode 3, as only one version of the UNIX tools (installed in /usr) can exist on a system.

like image 92
一二三 Avatar answered Nov 13 '22 10:11

一二三


I found a way to do it...I had to do changes directly into the installer script. The script is below. I will try to rename the folder as the other user suggested btw.

sudo hdiutil mount xcode_3.2.5_and_ios_sdk_4.2_final.dmg
cp -R /Volumes/Xcode /tmp/xcodetemp
sed 's,/Developer/,/Developer3_2_5/,' "/tmp/xcodetemp/Xcode for Snow Leopard.mpkg/Contents/iPhoneSDKSL.dist" > "/tmp/xcodetemp/Xcode for Snow Leopard.mpkg/Contents/iPhoneSDKSL.dist"
sudo installer -pkg  "tmp/xcodetemp/Xcode for Snow Leopard.mpkg" -target /Volumes/Macintosh\ HD
like image 33
Cornel Creanga Avatar answered Nov 13 '22 09:11

Cornel Creanga