WebStorm:为 React Native 设置模拟器 ID
WebStorm: Set simulator id for React Native
当我 运行 我的 React Native
应用程序 WebStorm
默认启动一个 iPhone X
模拟器。 WebStorm 的 React Native documentation 指出:
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"
.
我已将标志设置为 iPhone Xs Max
,如下所示:
但它仍在开始 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"
ID 0299DF16-DD84-40FB-8B37-55FC7EFCE271
是 iPhone X 的 ID。
我该如何更改?
我发现了问题。错误的是标志模拟器的破折号。当我从文档中复制代码时,它有短划线 ‑‑simulator
。正确的应该是 --simulator
.
当我 运行 我的 React Native
应用程序 WebStorm
默认启动一个 iPhone X
模拟器。 WebStorm 的 React Native documentation 指出:
If you selected the
Build and launch
checkbox, choose the target platform,Android
oriOS
. Depending on your choice,WebStorm
will run the bundler withreact-native run-ios
or withreact-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"
.
我已将标志设置为 iPhone Xs Max
,如下所示:
但它仍在开始 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"
ID 0299DF16-DD84-40FB-8B37-55FC7EFCE271
是 iPhone X 的 ID。
我该如何更改?
我发现了问题。错误的是标志模拟器的破折号。当我从文档中复制代码时,它有短划线 ‑‑simulator
。正确的应该是 --simulator
.