Could not find iPhone simulator after migrating from Xcode10 to Xcode11; React Native

Lawrence Eze
2 min readNov 19, 2019

--

xcode-react-native

Developers using older versions of react-native after upgrading from Xcode10 to Xcode11 are not able to run the iphone simulator on their mac. This can be annoying and stressful to debug, knowing that few minutes ago before the upgrade everything was fine. Sometimes, you wouldn’t even know where to start debugging.

After the upgrade, their was a slight change in the simulator properties, hence, the program is not able to find and use the simulator, thereby throwing “Could not find iPhone simulator error”.

To resolve this, goto the following path on your project: node_modules/react-native/local-cli/runIOS, then open the findMatchingSimulator.js file. On line 43 or so ensure the code block is same as this:

if (!version.includes(‘iOS’) && !version.includes(‘tvOS’)) {

continue;

}

Also where it is checking the simulator availability, around line 55, change the check for isAvailable from “YES” to true as seen below:

if (simulator.availability !== ‘(available)’ && simulator.isAvailable !== true){

continue;

}

Save the file and run start the simulator again (yarn ios or npm run ios as the case may be).

If you are experiencing the “Could not find iPhone X simulator error”, this is because iPhone X is used as default and maybe from your xcode, the iPhone X simulator is not installed. You can specify the the simulator version on the script session of your package.json file for ios as seen below:

“scripts”: {

“ios”: “react-native run-ios — simulator=’iPhone 11'”

}

Thanks for reading.

--

--