Tuesday, October 22, 2013

Changing which Xcode version to use on a Mac

On a Mac you can have two different versions of Xcode happily living side by side.
In my case I needed to be able to use both Xcode 4.6, and Xcode 5.0.
My build machine had version 5.0, and I needed to use version 4.6 temporarily.
This is how I carried it out.

 Install the old Xcode under /Applications/XCode4/
·         Check which Xcode version the xcodebuild version uses
o   Run xcodebuild –version
o   This for now will be Version 5.0
·         Check which path Xcodebuild uses
o   Run xcode-select --print-path
o   This should be /Applications/Xcode.app/Contents/Developer
·         Change which xcode version to use
o   Sudo xcode-select –switch /Applications/XCode4/Xcode.app/Contents/Developer
o   Enter the account/admin password
·         Check which Xcode version the xcodebuild version now uses
o   Run xcodebuild –version
o   This for now will be Version 4.6.3
·         Check which path Xcodebuild uses
o   Run xcode-select –print-path
o   This should be /Applications/XCode4/Xcode.app/Contents/Developer
·         Call Xbuildcode as normal  

To revert this change, we will need to :
·         Check which Xcode version the xcodebuild version uses
o   Run xcodebuild –version
o   This for now will be Version 4.6.3
·         Check which path Xcodebuild uses
o   Run xcode-select –print-path
o   This should be /Applications/XCode4/Xcode.app/Contents/Developer
·         Change which xcode version to use
o   Sudo xcode-select –switch /Applications /Xcode.app/Contents/Developer
o   Enter the account/admin password
·         Check which Xcode version the xcodebuild version now uses
o   Run xcodebuild –version
o   This for now will be Version 5.0
·         Check which path Xcodebuild uses
o   Run xcode-select –print-path
o   This should be /Applications/Xcode.app/Contents/Developer

·         Call Xbuildcode as normal  

No comments: