Can't find simulator - Xcode 9

I’m in the process of moving to Xcode 9 and although CircleCI prints out available simulators that contains:

iPhone 7 (11.0) [EC4E19CC-5F77-4D49-9828-99BC6417B0A8] (Simulator)

when I attempt:

dependencies:
  pre:
    # pre-start the simulator
    - xcrun instruments -w "iPhone 7 (11.0) [" || true

I’m met with:

CoreData: annotation:  Failed to load optimized model at path '/Applications/Xcode-9.app/Contents/Applications/Instruments.app/Contents/Frameworks/InstrumentsPackaging.framework/Versions/A/Resources/XRPackageModel.momd/XRPackageModel 9.0.omo'
instruments[1071]: Waiting for device to boot...
2017-09-21 07:24:07.852 instruments[1071:7816] [MT] iOSSimulator: Could not launch simulator: -10825
2017-09-21 07:24:07.852 instruments[1071:7816] Error encountered while starting session for "iPhone 7 (11.0)" (0D045C34-F3A0-4320-AF2D-C327CE4CEB04): Error Domain=NSOSStatusErrorDomain Code=-10825 "kLSIncompatibleSystemVersionErr: The app cannot run on the current OS version"
Instruments Usage Error: No template (-t) specified
instruments, version 9.0 (63198)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]

and later on when I attempt to run tests on the same simulator I receive the following error:

[07:29:22]: Ignoring 'iPhone 7 (11.0) [', couldn’t find matching simulator
[07:29:22]: Couldn't find any matching simulators for '["iPhone 7 (11.0) ["]' - falling back to default simulator
[07:29:22]: Found simulator "iPhone 5 (10.3)"

Another interesting fact, the devices listed when passing an invalid device does not contain an iPhone 5 (10.3) but does contain an iPhone 5 (10.3.1) so I’m not sure where xcrun and xcodebuild are looking for these devices but it doesn’t seem to be the correct location.

Can someone help me find out what I’m doing wrong here?

Thank you.

2 Likes

Looks like the Mac OS Image needs to be updated for Xcode 9 to work.

Xcode 9 Compatibility
Xcode 9 requires a Mac running macOS 10.12.6 or later.

https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html

When I print the Mac OS version on CCI using

sw_vers -productVersion

I get 10.12.5

Hello folks,

We’re working on updating the base os version, but in the meantime could you use xcrun simctl boot "iPhone 7 (11.0) [" rather than instruments.

I’ll update this thread, alongside posting a new thread when the update is completed.

Hi DanToml thanks for the response. I tried switching to xcrun simctl boot "iPhone 7 (11.0) [" and we are still seeing Invalid device: iPhone 7 (11.0) [
Thanks

DanToml, this would also only apply to the pre launching of the simulator correct? The problem also occurs when attempting to run tests.

1 Like

I was just wondering if there’s an ETA on this?

1 Like

Guys, we’re also facing this issue. Is there an ETA on it? It’s been 8 days already since last update.

We cannot boot device neither with xcrun instruments or xcrun simctl boot.

1 Like

FWIW, looks like the docs say 10.12.6, I’m running the build to see if it’s working. Will update with my findings.

Alright, it looks like they did update, so the Mac OS portion of the error should be gone using xcrun instruments. That being said I still get errors when trying to use scrub simctl boot. For the moment I’m planning to remove both and hope exit 65’s don’t come back.

That being said, now that the Mac OS version is correct I’m onto new problems. Looks like scan from fast lane is having issues finding a specific version of a simulator with Xcode 9. Open task is here for anyone interested.

https://github.com/fastlane/fastlane/issues/10338

1 Like

Any update? xcrun instruments nor xcrun simctl boot are able to preboot a simulator.

Any updates on this? Your documentation still recommends this approach to pre-start the Simulator:

https://circleci.com/docs/2.0/testing-ios/#pre-starting-the-simulator

I could make it work with this command
xcrun simctl boot “iPhone 7”

specific device name into it

1 Like