Search code examples
iosreact-nativeios-simulatorwebstorm

WebStorm: Set simulator id for React Native


When I run my React Native application WebStorm starting an iPhone X simulator by default. WebStorm's React Native documentation states that:

If you selected the Build and launch checkbox, choose the target platform, Android or iOS. Depending on your choice, WebStorm will run the bundler with react-native run-ios or with react-native run-android.

Optionally, type the arguments to be passed to React Native, for example, specify the simulator type through the ‑‑simulator flag: ‑‑simulator="iPhone 4s".

I have set my flag to iPhone Xs Max as shown below:

enter image description here

But it is still starting iPhone X:

react-native-cli run-ios "‑‑simulator=iPhone Xs Max"
info Found Xcode project MyProject.xcodeproj
info Building using "xcodebuild -project MyProject.xcodeproj -configuration Debug
    -scheme MyProject 
    -destination id=0299DF16-DD84-40FB-8B37-55FC7EFCE271
    -derivedDataPath build/MyProject"

The id 0299DF16-DD84-40FB-8B37-55FC7EFCE271 is id of iPhone X.

How can I change this?


Solution

  • I found the problem. What was wrong is dashes of flag simulator. When I copied the code from documentation it had short dashes ‑‑simulator. Correct one should be --simulator.