Table of Contents
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?
First of all, I want to highlight how we usually run our React Native app in the iOS simulator then we will see how to change the same command to run the app in the simulator you want. So to run any iOS app in the simulator we run
npx react-native run-ios
This command runs our app in the default simulator which is
"iPhone X" as per the official documents.
How to Specifying a Device to Change Default iOS Simulator?
So as I mention if you run the run-ios command it will run the application in the default
"iPhone X" but if you want to specify a device or simulator you can do it with the
--simulator flag, followed by the device name as a string.
So for example, if you wish to run your app on an iPhone 5s, run
npx react-native run-ios --simulator="iPhone 5s"
This will run you React Native App in the
How to Get the iOS Device List?
--simulator flag, followed by the device name is enough to run the app in a specific device but the question is how to get the list of device names so that we can use the correct device name?
To get the list of iOS devices available to use, you can use the following command from the console
xcrun simctl list devices
Screenshots to Get the List of Devices
Screenshots to Specifying a Device while Running iOS App
This is how to change the default iOS Simulator while Running React Native App. If you have any doubts or you want to share something about the topic you can comment below or contact us here. There will be more posts coming soon. Stay tuned!
Hope you liked it. 🙂