Thanks to Apple forcing my hand by auto installing Xcode 6, I had to quickly manage multiple versions of Xcode on my mac for Appcelerator mobile development.

Why multiple versions?

Xcode 6 has the iOS 8 SDK and Simulator by default. For some reason, I couldn’t get it to include the iOS7 SDK, which is what I require for my current development projects. This meant that I needed Xcode 5 back on my machine. I was quite nervous to delete Xcode 6 and replace it with Xcode 5 again, so I decided to install multiple versions of Xcode instead.

My first attempt failed

My first attempt was to do the following (Note: Here’s my blog post on how to achieve the below-mentioned):

  • Download Xcode 5.1.1 from the Apple Developer Center
  • Extract the 7.1 SDK and Simulator from Xcode 5.1.1 and paste it into Xcode 6
  • Restart Titanium Studio

This used to work in the past, but not this time. I kept getting random errors that I  haven’t seen before.

My second attempt succeeded

Thankfully, there’s more than 1 way to skin a cat. The following worked for me:

  • Download Xcode 5.1.1 from the Apple Developer Center Website (I named the file “xcode_5.1.1.dmg“)
  • Double click the DMG file and drag the “XCode.app” icon on to the “Applications” icon.
  • When prompted if you want to “Replace” or “Keep Both” files, choose “Keep Both“.

Apple1

 

  • Once the copy is complete, navigate to the Applications Folder and rename the new Xcode2.app to “Xcode511.app”

Apple2

Now, what we need to do is tell Titanium which Xcode to point to. By default, Titanium looks at the default “Xcode.app” file in the Applications folder. In this scenario, we want Titanium to point to the “Xcode511.app”.

To achieve this, do the following:

  • Open Terminal
  • Type in “sudo xcode-select -switch /Applications/Xcode511.app/Contents/Developer”
  • Restart Titanium Studio
  • In the Top Menu, navigate to “Titanium Studio > Preferences > Studio > Platforms > iOS”
  • Next to iOS SDK Home, click on the “Refresh” button.

Apple3

 

And that’s it. Hopefully this will do the trick for you as well.

Till next time
John