Navigate back to the homepage

Running React Native apps on specific iOS simulators

Perttu Lähteenlahti
October 31st, 2019 · 1 min read

If you’re developing React Native apps for iOS you’re most likely familiar with this command:

1react-native run-ios

In most cases that command opens up the iPhone X simulator. Instead, if you want to open your React Native app in a specific simulator you can also add the wanted device name with the simulator flag like this:

1react-native run-ios simulator='iPhone 8'

And it will open up the iPhone 8 Simulator. You can get the full list of available devices with the command

1xcrun simctl list devices

And here’s a list of all the available devices available for testing:

1react-native run-ios --simulator="iPhone 5s"
2react-native run-ios --simulator="iPhone 6"
3react-native run-ios --simulator="iPhone 6 Plus"
4react-native run-ios --simulator="iPhone 6s"
5react-native run-ios --simulator="iPhone 6s Plus"
6react-native run-ios --simulator="iPhone 7"
7react-native run-ios --simulator="iPhone 7 Plus"
8react-native run-ios --simulator="iPhone 8"
9react-native run-ios --simulator="iPhone 8 Plus"
10react-native run-ios --simulator="iPhone SE"
11react-native run-ios --simulator="iPhone X"
12react-native run-ios --simulator="iPhone XR"
13react-native run-ios --simulator="iPhone XS"
14react-native run-ios --simulator="iPhone XS Max"
15react-native run-ios --simulator="iPhone 11"
16react-native run-ios --simulator="iPhone 11 Pro"
17react-native run-ios --simulator="iPhone 11 Pro Max"
18react-native run-ios --simulator="iPhone XS Max"
19react-native run-ios --simulator="iPad Air"
20react-native run-ios --simulator="iPad Air 2"
21react-native run-ios --simulator="iPad"
22react-native run-ios --simulator="iPad Pro"
23react-native run-ios --simulator="iPad"

I’m getting “Could not find iPhone X simulator” or similar error message when running this command

At times you might run into problems with this command. This error message, for example, is quite common:

1Could not find iPhone X simulator
2
3Error: Could not find iPhone X simulator

This often caused by updating to a new Xcode version which doesn’t include the iPhone X simulator any more, which is the default for react-native-cli. This problem should disappear when you pass the simulator flag and another device than iPhone X.

This was a quick and simple guide to running on different iOS simulators when building React Native apps. I wrote this because I found myself googling different device names too often. I hope that you find it useful 🙂

More articles from React Native Club

Successful Rapid Prototyping With React Native

Transcript of the lightning talk I gave at React Day Berlin 2019 titled: 'Successful Rapid Prototyping With React Native'

October 31st, 2019 · 4 min read

App Store release checklist

Releasing to App store Getting your mobile app published in the App Store is simple in theory but tedious in practice. During the past nine…

October 15th, 2019 · 2 min read
© 2019 React Native Club
Link to $https://twitter.com/react.clubLink to $https://github.com/narative