Vscode-react-native: [Feature Request] Select iOS Simulator for "Run iOS on Simulator" target

Created on 5 Jun 2018  路  2Comments  路  Source: microsoft/vscode-react-native

Actual Behavior

  1. Launching the "Run iOS on Simulator" target always starts the iPhone 6 simulator

Expected Behavior

Launching the "Run iOS on Simulator" target should launch the app on the open simulator

or

There should be a configuration in the launch.json config specifying the name of the emulator that should be launched.

Software versions

  • React-Native VS Code extension version: 0.6.10
  • VSCode version: 1.23.1
  • OS platform and version: macOS 10.34.4
  • NodeJS version: 9.11.1
  • React Native version: 0.55.2
  • XCode version: 9.4 (9F1027a)
question waiting-for-clarification

Most helpful comment

Hi @peterjuras and thanks for your question.

Launching the "Run iOS on Simulator" target always starts the iPhone 6 simulator

To start running app extension is using react-native run-ios command. According to official React Native docs, in this case it is standard behavior:

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 6".

To run your app on different simulator you should create .vscode/settings.json file at the root of your project and fill it with the following content:

{
    "react-native.ios.runArguments.simulator": [
        "--simulator", "iPhone 7"
    ]
}

where iPhone 7 is the simulator name. To read more about specifying custom arguments for react-native run-* command, please, follow this documentation section.

Please let us know whether it helps you or not.

All 2 comments

Hi @peterjuras and thanks for your question.

Launching the "Run iOS on Simulator" target always starts the iPhone 6 simulator

To start running app extension is using react-native run-ios command. According to official React Native docs, in this case it is standard behavior:

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 6".

To run your app on different simulator you should create .vscode/settings.json file at the root of your project and fill it with the following content:

{
    "react-native.ios.runArguments.simulator": [
        "--simulator", "iPhone 7"
    ]
}

where iPhone 7 is the simulator name. To read more about specifying custom arguments for react-native run-* command, please, follow this documentation section.

Please let us know whether it helps you or not.

Thanks this solved my issue! 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kralcifer-ms picture kralcifer-ms  路  4Comments

peterp picture peterp  路  4Comments

webda2l picture webda2l  路  3Comments

molant picture molant  路  3Comments

vsccarl picture vsccarl  路  3Comments