美文网首页
react native:运行react-native run-

react native:运行react-native run-

作者: Volon | 来源:发表于2019-08-08 10:54 被阅读0次

报错代码:

Found Xcode project ****.xcodeproj

Could not find iPhone X simulator

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

解决方案:
打开文件: /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js
更改以下代码:

if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
  continue;
}

改为

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

相关文章

网友评论

      本文标题:react native:运行react-native run-

      本文链接:https://www.haomeiwen.com/subject/cfitjctx.html