Install Xcode 7 and Xcode 8 side by side

A new Xcode release is always an event.
New capabilities, new OS SDK, minor visual changes (which I’m always a fan of), and in recent years — new version of Swift.
In many cases, changes have to be made and the code needs to be upgraded to the latest version of Swift in order for it to compile with the newest OS SDK. This means some work has to be done on my part.

In the past, I was working with small teams where we were upgrading to the new version of Xcode on the day of release, since more times than not there were only small changes to be made. One developer would take the responsibility to update all the code in a separate branch and after making sure everything works properly, the changes would be merged to the develop branch and the rest of the team would upgrade to the new version of Xcode (usually during lunch) and pull the changes.

Good times had by all.

This year it’s been different.

Xcode 8, among other things, comes with Swift 3 which requires major work on our code. My team isn’t so small anymore and is spread between two different continents and a ten hours time difference.
No more lunch time upgrade!

Since we’re currently working on a large-scale project, we decided to wait for a less stressful time and only then do all the work on Swift 3 and the new SDK. Until we do — everyone works on Xcode 7(.3.1).

This is OK for work, but not me. It is very important to keep up to date with all the latest technologies from Apple — even if I don’t have actual use for it in my work project. I still want to work on personal stuff, and these will have to be built using Xcode 8.

I need to have two versions of Xcode installed on my machine.
Xcode 7.3.1 for work and Xcode 8.0 for good ol’ me!

So, after all this, here’s how to do that:
1. First, remove the current Xcode installation from your machine. You can probably skip this step but I wanted to start fresh. Plus — Xcode was behaving a little weird lately so this is a good opportunity to do that.
2. Install Xcode 8 from the App Store. Make sure project files (*.xcodeproj) and workspace files (*.xcworkspace) can be opened with the new Xcode installation (remember to select the Later option whenever prompted).
3. Download the Xcode 7.3.1 dmg file from Apple. Double-tap the newly downloaded dmg file in order to get the standard “Drag to install Xcode in your Applications folder”. Don’t do that. Instead, drag the Xcode icon to the desktop. Change the file name to Xcode 7.3.1. Now drag it to the Applications folder.

Now you have two versions of Xcode installed on your machine. Xcode 7.3.1 and Xcode 8.

Final step is to change the default version for opening project and workspace files:
7. Locate a project file (*.xcodeproj) on your system. Right click it and locate the Open With sub menu. Hold the option key on your keyboard to change it to Always Open With. Select Xcode 7.3.1 and make sure this is the version that was used to open the project.
8. Do the same for workspace files (*.xcworkspace)

That’s it! You’re done!

You can now keep working with Xcode 7.3.1 on your work stuff but still use Xcode 8 for your own side projects.

Note: before you comment — I know that Xcode 8 comes with Swift 2.3 which allows for a “half step” upgrade until we have time to fully upgrade to Swift 3. But, trying to make the app work with the new SDK turned out to be a difficult task by itself. So, we decided to wait and do the work on both at the same time.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.