How to Run React Native Apps on a Specific Device in the iOS Simulator

It can be frustrating when the officially recommended method for doing a thing doesn’t work. Here are some steps and commands to help you get your React Native app running on your preferred device in the iOS Simulator:

The React Native Docs recommend using the flag with :

If you run into (like I did):

Try running the script for iOS in your app’s (often it’s ):

In theory should work also, but I didn’t have any luck. Your mileage may vary:

List Available Devices

List available iOS devices:

Available devices for iOS on my machine:

Add Devices

To add additional devices:

  1. Launch Xcode
Xcode dock icon

2. Open Devices and Simulators (⇧⌘2)

Screenshot of the Window menu in Xcode with Devices and Simulators selected

3. Press Simulators Tab

Screenshot of Devices and Simulators window in Xcode

4. Press plus “+” button in the bottom left corner
5. Choose a Simulator Name, Device Type, and OS Version
6. Press blue button labeled “Create”

Screenshot of the “Create a new simulator” dialog in Xcode

Commands for Your Convenience

Here are some commands with yarn that are ready-to-use for your convenience:

Note

There is currently no way to set a default device for the Simulator.

More about:

Josh Buchea