Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 700
Olcay Ertaş Avatar asked May 23 '26 02:05

Olcay Ertaş


1 Answers

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.

like image 114
Olcay Ertaş Avatar answered May 25 '26 17:05

Olcay Ertaş



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!