React Native Change Default iOS Simulator Device

react-native run-ios --simulator
react-native run-ios device
react-native run-ios could not find simulator
react-native run-ios not launching simulator
change ios simulator version react native
react-native run-ios not working
xcode set default simulator
react native build ios

When I run this command:

react-native run-ios

My app runs by default in the iPhone6 simulator device:

Found Xcode project RN.xcodeproj
Launching iPhone 6 (9.2)...

How can I have the app run in a different simulator device (like iPhone5s) by default?

Specify a simulator using the --simulator flag.

These are the available devices for iOS 12.0:

react-native run-ios --simulator="iPhone 5s"
react-native run-ios --simulator="iPhone 6"
react-native run-ios --simulator="iPhone 6 Plus"
react-native run-ios --simulator="iPhone 6s"
react-native run-ios --simulator="iPhone 6s Plus"
react-native run-ios --simulator="iPhone 7"
react-native run-ios --simulator="iPhone 7 Plus"
react-native run-ios --simulator="iPhone 8"
react-native run-ios --simulator="iPhone 8 Plus"
react-native run-ios --simulator="iPhone SE"
react-native run-ios --simulator="iPhone X"
react-native run-ios --simulator="iPhone XR"
react-native run-ios --simulator="iPhone Xs"
react-native run-ios --simulator="iPhone Xs Max"
react-native run-ios --simulator="iPad Air"
react-native run-ios --simulator="iPad Air 2"
react-native run-ios --simulator="iPad"
react-native run-ios --simulator="iPad Pro"
react-native run-ios --simulator="iPad Pro"
react-native run-ios --simulator="iPad Pro"
react-native run-ios --simulator="iPad Pro"
react-native run-ios --simulator="iPad"

List all available iOS devices:

xcrun simctl list devices

There is currently no way to set a default.

React Native Docs: Running On Simulator

Set a default iOS simulator · Issue #169 · react-native-community/cli , react-native run-ios defaults to the iPhone X simulator; however, my preference is to use the iPhone XS Max. Could we have a way to set a  Change the Default iOS Simulator. Hello Guys, In this post, you will see how to Change the Default iOS Simulator while Running React Native App. This is a small post that will help you to specify the iOS device while running any React Native project for iOS. So let’s get started. How We Run our iOS App?

You can also use npm for this by adding an entry to the scripts element of your package.json file. E.g.

"launch-ios": "react-native run-ios --simulator \"iPad Air 2\""

Then to use this: npm run launch-ios

Running On Simulator · React Native, How to change it other simuloators? Like to iPhone X. react-native run-ios —-​simulator=”iPhone X”`. You can get the list of devices by running: By default, simulator is iPhone when you test React Native app. I know there is the --simulator flag : react-native run-ios --simulator 'iPad 2' Ok, but how to simulate ipad by default without this

There is a project setting if you hunt down:

{project}/node_modules/react-native/local-cli/runIOS/runIOS.js

Within there are some options under module.exports including:

options: [{ command: '--simulator [string]', description: 'Explicitly set simulator to use', default: 'iPhone 7', }

Mine was line 231, simply set that to a valid installed simulator and run react-native run-ios it will run to that simulator by default.

Setting a Default iOS Simulator for React Native, The default is "iPhone X" . If you wish to run your app on an iPhone 5s, run npx react-native run-ios --simulator="iPhone 5s" . The device names correspond to  You can specify the device the simulator should run with the --simulator flag, followed by the device name as a string. The default is "iPhone X". If you wish to run your app on an iPhone 5s, run npx react-native run-ios --simulator="iPhone 5s". The device names correspond to the list of devices available in Xcode.

You can create an alias at your ~/.bash_profile file:

alias rn-ios="react-native run-ios --simulator \"iPhone 5s (10.0)\""

And then run react-native using the created alias:

$ rn-ios

change simulator on iOS, The same principal will work with physical devices too, physical device deployment has it's own flag: device. I explained that in another article I  When testing a React Native app with react-native run-ios it opens an iPhone simulator. You can change the virtual device to an iPad in the Simulator options, but the React Native app does not app

1) Rename your simulator, If simulator with same name but different iOS version

Xcode -> Window -> Devices and Simulators -> Simulators.

2) Open your react native project folder

3) Edit package.json

"scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "flow": "node_modules/.bin/flow",
    "start-iphone6": "react-native run-ios --simulator \"iPhone 6 11.3\""
}

4) npm run start-iphone6

How to Run React Native Apps on a Specific Device in the iOS , react-native run-ios. it's not problem when we develop but when we want to test RN(react native) project on different device, it always  Now, use the below command to run the project on a specific simulator : npx react-native run-ios --simulator="iPhone 6" That’s it. Change default simulator : You can add one new script in default.json with your default simulator : "ios-default" : "npx react-native run-ios --simulator \"iPhone 6\"" Now, just use npm run ios-default to execute

Change Default iOS Simulator Device for React Native – Borort Sort, react-native run-ios --simulator=”iPhone 11 Pro Max”. If you run into Note. There is currently no way to set a default device for the Simulator. This is how you can change the Icon of your React Native Application for Android and iOS both. Alternate Way to Change App Icon in React Native Using Command Line Interface If you are using MAC or Ubuntu you can also see the alternate way below.

React Native Change Default iOS Simulator Device, Change Default iOS Simulator Device for React Native. react-native run-ios --​simulator="iPhone 5s" react-native run-ios --simulator="iPhone 6"  Debugging Application State. Reactotron is an open-source desktop app that allows you to inspect Redux or MobX-State-Tree application state as well as view custom logs, run custom commands such as resetting state, store and restore state snapshots, and other helpful debugging features for React Native apps.

Change Default iOS Simulator while Running React Native App, When I run this command: react-native run-ios My app runs by default in the iPhone6 simulator device: Found Xcode project RN.xcodeproj Launching iPhone 6  Debug App in Real Android Device using Wi-Fi Connection. How to Run React Native App On Real Device using Wi-Fi is the extended version of our previous post on How to Run React Native App On Real Device Android which has a description of how to run the App using USB cable in Real Device.

Comments
  • Xcode --> Product --> Destination ??
  • I don't know how to setup default device, but after running react-native run-ios you can change device in Simulator > Hardware > Device > iOS x.x > iPhone 5. This will work until you quit simulator.
  • thnx a lot it helped
  • And if you want; react-native run-ios --simulator="iPad Air"
  • To see all the available devices you can use xcrun simctl list devices more info here
  • Just in case if you have multiple simulator with same name for example iPhone 6s for ios 11 , iPhone 6s for ios 12 etc, then you can set specific name to simulator from Xcode -> Window -> Devices and Simulators
  • Why multiple "iPad Pro"s ?
  • IMHO this is the best answer as it allows you to store the config in code/version control. Means you dont need to remember the command line syntax.
  • I agree with this answer. You can also get by with singlequotes: "launch-ios": "react-native run-ios --simulator 'iPad Air 2'"
  • This actually worked, although file was hidden inside {project}/node_modules/react-native/local-cli/runIOS/
  • Great solution. Thanks!
  • I don't actually have that module under node modules folder.
  • Yup, adding "runArguments": [ "--simulator", "iPhone 5s" ] to my launch configuration worked perfectly.