Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have multiple Xcode versions installed?

Tags:

xcode

macos

People also ask

How do I install an older version of Xcode on Mac?

Older versions of Xcode can be found by logging into the Apple Developer Downloads page and searching for the version of Xcode you need.

How can I change Xcodebuild version?

Outside the terminal, you can view and change this in Xcode. Open Preferences, then select the Locations tab. Near the bottom, an entry titled Command Line Tools labels a dropdown, whose selection corresponds to the version of Xcode used in xcodebuild .


Yes, you can install multiple versions of Xcode. They will install into separate directories. I've found that the best practice is to install the version that came with your Mac first and then install downloaded versions, but it probably doesn't make a big difference. See http://developer.apple.com/documentation/Xcode/Conceptual/XcodeCoexistence/Contents/Resources/en.lproj/Details/Details.html this Apple Developer Connection page for lots of details. <- Page does not exist anymore!


It's easy to have multiple Xcode installs.

In the installer there's a pulldown for the location... you just need to pick a new location when you're installing the beta version.

These instructions from an Apple dev tools evangelist have the full details (Apple dev username/password required): https://devforums.apple.com/message/40847#40847

Then grab yourself a custom icon for the Beta version of XCode you're using, so you can tell them apart in the dock: http://iphonedevelopment.blogspot.com/2009/03/multiple-developer-tool-installs.html


Can I have multiple Xcode versions installed?

Solution:
Actually as many of the above answers says, it is possible. Even according to the following Oracle Mobile Platform Blog, you can install more than one XCodes in the same Mac. The reason why you need to do that may vary according to you.

Scenario:
You might have installed only one version of XCode for now. Mostly the one release behind the latest XCode version which is available through App Store (mine I've Xcode 6.3.2 and I needed to keep it and also install Xcode 7 which is available through App Store).

For Ex:-

You have already installed XCode 6.x, and App Store has XCode 7 already given by App Store. For any reason you need to keep that Older XCode 6.x(as you know it is stable for some time now) and also you need to install and try out new XCode 7

So number one question might be, How and Where could you download the Mac OS X installable DMG file for XCode 7 (or may be if you wanna try out an older XCode version)? Ok, here is the direct link apple downloads (you might have to log into Apple Developer account before viewing this link correctly), or else following is a StackOverflow Q&A link which gives the answer to where to download DMG files for XCode IDEs.

So now let's assume that you have obtained any of the DMG file for the XCode version you require to install as secondarily?

Steps:
Follow the steps given bellow which I got from the above given first link of Oracles Mobile Platform Blog.

  1. Close Xcode if running
  2. Rename /Applications/Xcode.app to /Applications/Xcode_6.x.app
  3. Enter the admin password when prompted
  4. Double click the DMG file of your required, pre-downloaded Xcode and install it
  5. Once installed it, before running it, change the new /Applications/Xcode.app that was just installed to (according to my above given example) /Application/Xcode_7.app

Note*:

[Please patiently read this section until the next Note] When you have two versions of Xcode installed, your workstation has two versions of Command Line Tool (xcodebuild) installed too. The question is what your Terminal and Xcode build command will use to when you are building your iOS App. Because along with the Command Line Tool, iOS SDK which is being used to build your app also depends on.

My experience was I've had two Xcode versions. Xcode 10 (Old one with iOS12.0 - iphoneos12.0), and Xcode 10.1 (New one with iOS 12.1 - iphoneos12.1). So obviously the settings for Command Line Tool was selected to use xcodebuild tool from the Old app. I had to manually select it in Xcode preference window.

Where to set Command Line Tool in Xcode Preference Window?

  • Select the Locations tab and there, you can select all the installed versions of Command Line Tools (which is xcodebuild).

How to figure out which version of iOS SDK is being used to build your iOS App?

  • On your Terminal issue following command: $> xcodebuild -showsdks
  • Above command should print out all the SDK details which your current Xcode configuration uses to build your Apps. And by seeing the results you will understand that your iOS/iphoneos SDK version depends on changing Command Line Tool (xcodebuild) setting on your Xcode.

Note**:
Above given Apple Downloads link and Oracles MPF blog post links might change and/or unavailable in the future.

So I hope that my this answer might be helpful to somebody else out there!
Cheers!


You may want to use the "xcode-select" command in terminal to switch between the different Xcode version in the installed folders.


It seems that Xcode really likes to be in the Applications folder and be called Xcode, especially when using xcodebuild (when building for Carthage for example) - and xcode-select doesn't always seem to cut it.

I have a client project that's still using Swift 2.2, and I'm stuck on Xcode 7 for that and using Xcode 8 for anything else.

So, in my Applications folder, I have Xcode 7 (renamed to Xcode_7) and Xcode 8 (renamed to Xcode_8). Then I rename whichever one I need to simply Xcode, and back again when done. It's a ball-ache, but seems to work.

This shell script simplifies it a bit…

xcode-version.sh

cd /Applications

if  [[ $1 = "-8" ]]
then 
    if [ -e Xcode_8.app ] 
    then            
        mv Xcode.app Xcode_7.app
        mv Xcode_8.app Xcode.app
        echo "Switched to Xcode 8"
    else
        echo "Already using Xcode 8"
    fi
elif  [[ $1 = "-7" ]]
then
    if [ -e Xcode_7.app ] 
    then            
        mv Xcode.app Xcode_8.app
        mv Xcode_7.app Xcode.app
        echo "Switched to Xcode 7"
    else
        echo "Already using Xcode 7"
    fi
else
    echo "usage: xcode-version -7/8"
fi

xcode-select --switch Xcode.app