react-native找不到模拟器 Could not find iPhone X simulator

test git:(develop) ✗ react-native run-ios 
Found Xcode project OKWallet.xcodeproj

Could not find iPhone X simulator

Error: Could not find iPhone X simulator
    at resolve (/Users/u1/test/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
    at Promise (<anonymous>)
    at runOnSimulator (/Users/u1/test/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
    at Object.runIOS [as func] (/Users/u1/test/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
    at Promise.resolve.then (/Users/u1/test/node_modules/react-native/local-cli/cliEntry.js:117:22)
    at <anonymous>

解决方法:

第一步:更改node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 第42行

    if (
      !version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') &&
      !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS')
    ) {
      continue;
    }

第二步:更改node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 第56行

if (!simulator.isAvailable) {
        continue;
      }

具体参考链接

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页