react-native run-ios Could not find iPhone X simul

2020-05-05 18:19发布

问题:

I first started my project with Expo and ejected it. Now, I'm trying to run the command react-native run-ios and it comes back with this error:

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'

Then it gives another error:

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening blahblahblah.xcworkspace

$ react-native run-ios info Found Xcode workspace blahblahblah.xcworkspace 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' info Launching iPhone X (iOS 12.2)... info Building using "xcodebuild -workspace blahblahblah.xcworkspace -configuration Debug -scheme weather -destination id=E05006E8-DEB3-4317-967B-40759D275997 -derivedDataPath build/weather" info User defaults from command line:

info IDEDerivedDataPathOverride = /Users/blahblahblah/Desktop/blahblahblah/ios/build/blahblahblah

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening blahblahblah.xcworkspace

Any help would be greatly appreciated!

Thank you!

回答1:

use this.

react-native run-ios --simulator="iPhone 8"


回答2:

This issue:

https://github.com/react-native-community/cli/pull/414

was fixed on @react-native-community/cli v1.9.8:

https://github.com/react-native-community/cli/releases/tag/v1.9.8

A bump in your yarn.lock to some version over 1.9.8 should fix it.