Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

react-native run-ios fails with XCode 10.2: "Could not find iPhone X simulator" #164

Closed
robrecord opened this issue Apr 1, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@robrecord
Copy link

robrecord commented Apr 1, 2019

I initialized a new app then tried to run it with react-native run-ios, but I get the following:

$ react-native run-ios

Found Xcode project myAwesomeProject.xcodeproj

Could not find iPhone X simulator

Error: Could not find iPhone X simulator
    at resolve (/Users/username/Apps/myAwesomeProject/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
    at new Promise (<anonymous>)
    at runOnSimulator (/Users/username/Apps/myAwesomeProject/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
    at Object.runIOS [as func] (/Users/username/Apps/myAwesomeProject/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
    at Promise.resolve.then (/Users/username/Apps/myAwesomeProject/node_modules/react-native/local-cli/cliEntry.js:117:22)

This happens also with Expo (using the same version of react-native, 0.57.*) but does not happen when initializing an app with the latest react-native 0.59

This is on macOS 10.14.4 and XCode 10.2

Editing package.json to use react-native 0.59.3 in the dependencies (and then yarn install) fixes this issue, but then the project fails to build.

@robrecord robrecord changed the title Could not find iPhone X simulator react-native run-ios fails with XCode 10.2: "Could not find iPhone X simulator" Apr 1, 2019
@robrecord
Copy link
Author

robrecord commented Apr 1, 2019

This is fixed in react-native-cli but not yet released react-native-community/cli#274

@kevinvangelder
Copy link
Member

Yeah, this is one of the reasons we try to never update XCode until it's been out and stable for at least several months.

@austenjt
Copy link

austenjt commented Apr 5, 2019

Sounds familiar. I think you can temporarily fix this by editing the findMatchingSimulator.js to use .includes rather than .startsWith for the iOS matcher. I think react-native has a 0.59 patch coming out to fix it soon? I had this same problem with react-native itself and with Appium.

@jamonholmgren
Copy link
Member

Confirmed this is an issue.

@jamonholmgren jamonholmgren added the bug Something isn't working label Apr 9, 2019
@budda
Copy link

budda commented Apr 10, 2019

Confirmed fixed in the new release of ignite-bowser.

@olegmilan
Copy link

Sounds familiar. I think you can temporarily fix this by editing the findMatchingSimulator.js to use .includes rather than .startsWith for the iOS matcher. I think react-native has a 0.59 patch coming out to fix it soon? I had this same problem with react-native itself and with Appium.

Thanks @austenjt, this worked for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants