Why can't xcodebuild find the 8.4 simulator ?

Hi all,


I just updated to XCode 7 and ran into some issues with our project. We build from Jenkins using xcodebuild

and we use iphonesimulator8.4 for testing. I have it installed but still get this:


xcodebuild: error: SDK "iphonesimulator8.4" cannot be located.


It does show up under "/Library/Developer/CoreSimulator/Profiles/Runtimes"but does NOT show up under

"/Users/nmodin/Library/Developer/Xcode/iOS DeviceSupport." Only 9.0 can be found here. In addition it

is missing from "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs".


I don't really remember where it is actually supposed to show up, but at the end of the day xcodebuild can't find it.


Anyone else experienced this ? Any hints about what I should be looking for ?


Cheers,

Niklas

Answered by nmodin in 61610022

Ah I see.


How do we go about to get the runtime installed ? Is it possible ?


Looking at XCode -> Window -> Devices and I have quite a few iOS 8.4 devices installed, so I assume these are not runtimes then ? (Tried to add a device called iphonesimulator8.4 but that didn't fix anything).


I also tried copying the iphonesimulator8.4 folder from XCode 6.4 to XCode 7 with no luck. (No entitlement for 'Application')


UPDATE:


I simply just removed the hardcoded 8.4 part of my pom.xml to point to just <argument>iphonesimulator</argument> and that works fine, so I'm a happy camper now ! 🙂

You are conflating SDK and Runtime, which is understandable given the way the simulator has (and still is) shipping.


You want to build against the iphonesimulator SDK and run your results in the iOS 8.4 simulator runtime.

I've got this problem as well. Updated to Xcode 7 and installed 8.4 simulator and it shows as installed under Preferences/Download.

But running "xcodebuild -showsdks" I only get


OS X SDKs:
  OS X 10.11                    -sdk macosx10.11
iOS SDKs:
  iOS 9.0                       -sdk iphoneos9.0
iOS Simulator SDKs:
  Simulator - iOS 9.0           -sdk iphonesimulator9.0
watchOS SDKs:
  watchOS 2.0                   -sdk watchos2.0
watchOS Simulator SDKs:
  Simulator - watchOS 2.0       -sdk watchsimulator2.0


When trying to start the simulator from commandline on Jenkins server I get

xcodebuild: error: SDK "iphonesimulator8.4" cannot be located.

Yes. You installed the iOS 8.4 Simulator *RUNTIME* not the iOS 8.4 Simulator *SDK*


You want to build against the iphonesimulator SDK (which is version 9.0) and run the restulting app in the iOS 8.4 Simulator Runtime.

Accepted Answer

Ah I see.


How do we go about to get the runtime installed ? Is it possible ?


Looking at XCode -> Window -> Devices and I have quite a few iOS 8.4 devices installed, so I assume these are not runtimes then ? (Tried to add a device called iphonesimulator8.4 but that didn't fix anything).


I also tried copying the iphonesimulator8.4 folder from XCode 6.4 to XCode 7 with no luck. (No entitlement for 'Application')


UPDATE:


I simply just removed the hardcoded 8.4 part of my pom.xml to point to just <argument>iphonesimulator</argument> and that works fine, so I'm a happy camper now ! 🙂

> How do we go about to get the runtime installed ? Is it possible ?

Accodring to your post, you did that. That's what you downloaded and installed through Xcode -> Preferences -> Downloads

> so I assume these are not runtimes then ?

They are devices that are using the (downloaded and available) iOS 8.4 Simulator runtime.

> I also tried copying the iphonesimulator8.4 folder from XCode 6.4 to XCode 7 with no luck.

Don't do that. You probably invalidated the signature which will force a full redownload from the store when you do an update in the future.

> I simply just removed the hardcoded 8.4 part of my pom.xml to point to just <argument>iphonesimulator</argument> and that works fine, so I'm a happy camper now

Yes, that's exactly what I said.

To specifiy a specific simulator runtime you can do something like this:

xcodebuild test -workspace MyProject.xcworkspace/ -scheme MyScheme -configuration UnitTest -sdk iphonesimulator -destination "platform=iOS Simulator,OS=8.4,name=iPhone 4s" -destination-timeout 1
Why can't xcodebuild find the 8.4 simulator ?
 
 
Q