React Native Run Ios Iphone

Posted on  by
  1. Native Run Music
  2. React Native Ios Windows
  3. React Native Run Ios Iphone 6s

By default, React Native only targets iPhone - so if you run on an iPad, it will show up as a scaled app, and won't look like a native iPad app. To target both iPhone and iPad, you have to change the xcode project to build it as a universal app.

10 Oct 2019
EnvironmentsVersion
react-native0.60.4
Xcode11.1

After updating Xcode to Version 11.1 (11A1027) I encountered ‘iPhone X’ not found error when running react-native run-ios.

The default is 'iPhone X'. If you wish to run your app on an iPhone 5s, run react-native run-ios -simulator='iPhone 5s'. The device names correspond to the list of devices available in Xcode. You can check your available devices by running xcrun simctl list devices from the console. Here is the output: npx react-native run-ios -device 'Bide’s iPhone' info Found Xcode workspace 'kisschatproudchat.xcworkspace' `instruments` is now deprecated in favor of 'xcrun xctrace' (see `man xctrace` for more information on its replacement).

It’s mainly because new Xcode version does not have ‘iPhone X’ anymore.Actually iPhone model name has been slightly changed. ‘iPhone Xs’ Became ‘iPhone 11 Pro’. Some of other recent models has simmilar changes.

Possible Solutions

Specifying Device

When running react-native run-ios command, you can specify device that exists.

React native run ios iphone 7

It is the most simpleast solution, yet it’s quite annoying, since you have to type longer command.

Change Default Virtual Device

Native Run Music

You can change default running virtual device in node_modules.Open up “/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js” in your text editor.

See “default”? Just change it to something like “iPhone 11 Pro” or else.

React Native Ios Windows

The problem is, whenever you install node_modules again, it goes back to “iPhone X”.

Recommanded Solution

It is kind a tricky solution but easy and certain. Just add “iPhone X” to your Xcode.Press Button marked as in image above.Then, press plus button.Add “iPhone X”.

References

Related Posts

Please enable JavaScript to view the comments powered by Disqus.

Starting the simulator

Once you have your React Native project initialized, you can run react-native run-ios inside the newly created project directory. If everything is set up correctly, you should see your new app running in the iOS Simulator shortly.

Specifying a device

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 react-native run-ios --simulator='iPhone 5s'.

React Native Run Ios Iphone 6s

The device names correspond to the list of devices available in Xcode. You can check your available devices by running xcrun simctl list devices from the console.