在终端使用 react-native run-ios 后报错
Could not find iPhone X simulator
Error: Could not find iPhone X simulato
解决方法: 找到 /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 做如下修改
if (!version.startsWith('iOS') && !version.startsWith('tvOS')){
continue;
}
//修改成
if (!version.includes('iOS')) {
continue;
}
指定模拟器运行
react-native run-ios --simulator "iPhone 8"
查看模拟器列表
xcrun simctl list devices