By Chris Muir-Oracle on Dec 01, 2014
(Phew, that's likely the most complex sentence I've ever written).
Firstly it is correct to say only Xcode 6+ includes an iOS 8 Simulator (and 7.0 and 7.1 for the record as a separate download), but Xcode 5.1.1 only supports upto iOS 7.1.
However it is incorrect to say a Mac can only have one Xcode version installed.
Let's discuss what you need to know to install a second Xcode.
Installing multiple Xcodes
Typically Xcode is installed via the Apple App Store, and this will install the most recent version (at the time of writing this was Xcode 6.1). Now Oracle MAF 2.0.1 customers will have Xcode 5.1.1 installed, and likely was installed via the same App Store route, just you haven't upgraded yet.
So you may have 5.1.1 installed, or 6.1 installed, but not both. Whichever is installed will be found under /Applications/Xcode.app.
If you currently have 5.1.1 installed and you want to also install 6.1, follow these steps:
b) Rename /Applications/Xcode.app to /Applications/Xcode5.app
c) Enter the admin password when prompted
d) Goto the Apple App Store and download Xcode again
e) Once downloaded, before running it, change the new /Applications/Xcode.app that was just installed to /Application/Xcode6.app
There is a couple of confusing things that will happen during step "d". When you go to the App Store, the button will show "Upgrade" rather than "Install". You can ignore this, the App Stores doesn't know you've moved the currently installed Xcode. Then while the app is downloading you may notice in the Mac Launchpad that it can get confused and it shows the original Xcode icon getting upgraded rather than a separate install. You can ignore this too, this will right itself eventually and you'll end up with two Xcode icons, Xcode5 & Xcode6.
For customer's that already have Xcode 6.1 installed, but not 5.1.1, the steps for you are slightly longer as the App Store doesn't allow you to download previous versions of software. For this we need to use the Apple Developer Center
a) Close Xcode if running
b) Rename /Applications/Xcode.app to /Applications/xcode6.app
c) Enter the admin password when prompted
d) Login to the Apple Developer Center Member Center (you will need an Apple Developer Account to do this)
e) Access the Downloads page
f) Search for the relevant Xcode version (e.g. Xcode 5.1.1)
g) Download the .dmg file
h) Once download execute the .dmg file to install Xcode
i) Once Xcode is installed, ensure it is closed
j) Rename the new /Applications/Xcode.app to /Applications/Xcode5.app
What can go wrong?
If you've already JDeveloper 188.8.131.52.0 and MAF 2.0.1 installed & have been using it successfully on your Mac to test iOS apps, you need to remember that the Preferences -> Mobile Application Framework -> iOS settings are still pointing to the old /Applications/Xcode.app. You need to change this to /Applications/Xcode5.app otherwise you can't build your application.
DO NOT change this to Xcode6.app, MAF 2.0.1 does not support Xcode 6. An upcoming MAF version will.
But how do I test with the iOS 8 Simulator then?MAF will support Xcode 6+ in an upcoming release which will mean you can deploy from MAF straight to an iOS 8 Simulator. For the moment with the above dual Xcode setup you need to do the following:
a) In JDeveloper with your current MAF 2.0.1 installation which uses Xcode 5, select the Build menu Clean All option
b) Deploy your application to the iOS Simulator via the Deploy menu as you would normally
This will open the iOS 7.X simulator attached to Xcode 5.1.1. We're not actually interested in this, rather the previous step forced JDeveloper to build the temporary iOS project for us which we'll use next.
c) Close JDeveloper down
d) Close the simulator
e) Close Xcode if running
f) Open Xcode6
g) Select Open Project
h) In the file dialog locate the base directory of your app's source code on the local Mac file system, then select deploy/iOS1/temporary_xcode_project/Oracle_ADFmc_Container_Template.xcodeproj (note the iOS1 directory name depends on your deployment profile names, this may differ in your application)
i) In the Xcode 6 IDE, select the same named project in the left Project Navigator
j) Via the Product menu Destination options, select an iOS 8.X device under the iOS Simulator heading (e.g. iPhone 5s (8.1))
k) Via the Product menu select Run
l) The app will build, and after sometime the iOS 8 Simulator will launch with your app starting automatically
When you return to JDeveloper + MAF, ensure to do a Build menu Clean All in your application before testing again especially through the previous version 5 of Xcode. This is necessary because as you've just executed a build under Xcode 6, incorrect versioned artifacts may have been created in the temporary_xcode_project directory. Amongst Oracle staff we use the Clean All function religiously.