实际问题
react-native run-ios
脚本却会抛出如下错误:
Could not find iPhone X simulator
在网上也能找到一些解决方案,比如下面这个:
react-native run-ios returns Error: Could not find iPhone X simulator
上面文章的解决方案是将 /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js
中的
// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
continue;
}
改为
// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
if (!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvO