11

Anyone else getting this since upgrading from Xcode 10.3 to Xcode 11 when running react-native run-ios and any idea to get back up and running?

CoreData: annotation:  Failed to load optimized model at path '/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks/InstrumentsPackaging.framework/Versions/A/Resources/XRPackageModel.momd/XRPackageModel 9.0.omo'
error Could not find iPhone X simulator
Cœur
  • 37,241
  • 25
  • 195
  • 267
Leo
  • 10,407
  • 3
  • 45
  • 62
  • Sorry, reopened. I misinterpreted a duplicate answer posting, confusing two authors. – Martijn Pieters Sep 24 '19 at 11:16
  • Did you find an answer? – Sara Inés Calderón Sep 25 '19 at 21:07
  • We've had to downgrade back to Xcode 10.3 in the end based on the complexity of our dependencies, so back to running iPhone X simulator on all versions of iOS as normal. Back to playing the waiting game with a beady eye. – Leo Sep 26 '19 at 10:04
  • I get this error using `instruments -s devices`. Does any one have the same problem? – Pedro Silva Oct 03 '19 at 14:48
  • @PedroSilva This would make sense and is expected when it comes to reaching listing your `iPhone X` devices the same way `react-native run-ios` looks for the `iPhone X` by default. So in theory the temporary fix should solve. – Leo Oct 03 '19 at 15:06
  • @JuanguiJordán Just to clarify, this question was asked earlier _Sept 23_; the question you have linked was asked later _Oct 2_. The appropriate etiquette is to flag the the latter as a duplicate and vote to close it, not the original. – Leo Oct 07 '19 at 10:53
  • Ok, @Leo, I will try, but one of the admins removed my answer here, I don't know if I will be able to handle all the changes. – Juangui Jordán Oct 07 '19 at 13:25
  • I'm sorry, it won't let me post my answer here again, then flag the other one as duplicate of this one – Juangui Jordán Oct 07 '19 at 13:28
  • @JuanguiJordán Hmm I wonder why it was removed. I'd remove your previous comment to prevent further confusion, then write a new comment here something like: _Possible answer: _ – Leo Oct 07 '19 at 13:48
  • Possible answer: https://stackoverflow.com/questions/58207838/react-native-run-ios-could-not-find-iphone-x-simulator-xrpackagemodel-9-0-omo/58266877#58266877 – Juangui Jordán Oct 08 '19 at 15:58

5 Answers5

23

I remember this happening before and amending:

node_modules⁩ ▸ ⁨@react-native-community⁩ ▸ ⁨cli⁩ ▸ ⁨build⁩ ▸ ⁨commands⁩ ▸ ⁨runIOS⁩ ▸ findMatchingSimulator.js

As a current workaround, updating:

if (simulator.availability !== '(available)' && simulator.isAvailable !== 'YES') {
  continue;
}

To:

if (simulator.availability !== '(available)' && simulator.isAvailable !== true) {
  continue;
}

Seems to get me back up and running.

Hopefully this gets updated pronto.


"react-native": "^0.59.3"

Leo
  • 10,407
  • 3
  • 45
  • 62
10

Xcode 11 can't see iPhoneX or Other Simulator - First need to add new Simulator - Then click on the bottom left of the Simulator then choose device you wanna add

First need to add new Simulator

Then click on the bottom left of the Simulator then choose device you wanna add

Chea Sambath
  • 1,305
  • 2
  • 13
  • 16
  • Thank you for your contribution, but this has already been covered, scroll down: https://stackoverflow.com/questions/58060484/xcode-11-upgrade-could-not-find-iphone-x-simulator-xrpackagemodel-9-0-omo/58539400#comment102523781_58063709. I.e. This does _not_ work. – Leo Oct 24 '19 at 10:32
4

Open xcode and go to window > Device and Simulators... go to the Simulators tab and click the + in the bottom left, here you can add iphone X.

  • Thank you for your contribution, but the iPhone X and subsequently other simulators are already added. Removing then re-adding them has no effect. – Leo Sep 23 '19 at 13:38
  • 1
    The iPhone X simulator wasn't already added in my specific use case, so this and the answer above were the solutions for me – Steven Harlow Oct 28 '19 at 23:30
  • 1
    This answer still works in 2021 January for Xcode Version 12.3 (12C33) – Dami Jan 21 '21 at 05:41
3

You can change the default simulator to use.

react-native run-ios --simulator="iPhone 11 Pro Max"

Andrei Calazans
  • 453
  • 7
  • 16
  • Thank you for your contribution, yes this command runs a specified simulator, but this does not run the `iPhone X simulator`. In this context, `X` stands for `10`, not any generic version. – Leo Sep 23 '19 at 17:38
0

The problem is that you are using a @react-native/cli version that doesn't detect XCode 11 simulators. You can either downgrade your XCode or install a @react-native/cli that supports it.

If you are not managing the version of @react-native/cli directly in your package.json you can simply remove your package-lock.json or yarn.lock file and install it again:

rm yarn.lock 
yarn install

or

rm package-lock.json
npm install
Tim Givois
  • 1,926
  • 2
  • 19
  • 36