【问题标题】:How to change the default Xcode iphone simulator when testing in the terminal?在终端测试时如何更改默认的 Xcode iphone 模拟器?
【发布时间】:2018-04-15 02:02:41
【问题描述】:
【问题讨论】:
标签:
xcode
react-native
terminal
ios-simulator
【解决方案1】:
您可以在命令中提供您喜欢的模拟器:
react-native run-ios --simulator="iPhone5"
您可以通过从终端运行以下命令来检查可用的模拟器:
xcrun simctl list devices
【解决方案2】:
你在终端运行时中的 Package.json 中设置你点击这些像 yarn ios-max
"scripts": {
"reinstall": "rm -rf node_modules; yarn cache clean; yarn install",
"ios": "react-native run-ios",
"ios-min": "react-native run-ios --simulator 'iPhone 5s'",
"ios-mid": "react-native run-ios --simulator 'iPhone 8 Plus'",
"ios-max": "react-native run-ios --simulator 'iPhone X'",
"ipad": "react-native run-ios --simulator 'iPad Air'",
"ios-device": "react-native run-ios --device",
"android-min": "react-native run-android",
"android-max": "react-native run-android",
"android-release": "react-native run-android --variant=release",
}
【解决方案3】:
模拟器 -> 硬件 -> 设备 iOS 11.1 -> 默认点击一个