I have just upgraded my Mac OS to 10.9.3 from a Mac OS to 10.6.8. I had a XCode 3.2.6 installed. For new developments, I needed to install XCode 4.5.2.
In a maven build, I invoke xcodebuild to build some C++ projects. The problem is I need xcodebuild 3.2.6 to build certain projects, and xcodebuidl 4.5.2 for some new ones.
I need to be able to choose on-the-fly the xcodebuild version to launch a build on a project. I saw xcode-select could help me doing this, but I get stuck on the way to use xcode-select to choose xcodebuild 3.2.6.
Considerong my XCode 4.5.2 is installed at /Applications/Xcode.app, using command
sudo xcode-select -switch /Applications/Xcode.app
does the job, as
xcodebuild -version
outputs
Xcode 4.5.2
Build version 4G2008a
Considering my XCode 3.2.6 is at /Developer/Applications/Xcode.app, my problem is, why does this command not work?
sudo xcode-select -switch /Developer/Applications/Xcode.app
It outputs
xcode-select: error: invalid developer directory '/Developer/Applications/Xcode.app'
The only workaround I could find is using the absolute path to use xcodebuild 3.2.6, but that's tricky:
/Developer/usr/bin/xcodebuild
Is there a clean way to select xcodebuild 3.2.6 with xcode-select?