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;
      }

具体参考链接

你可能感兴趣的:(React,Native)