Could not find iPhone 6 simulato

2019-05-17  本文已影响0人  pengxiaochao

react-native run-ios 无法启动模拟器

报错截图
Scanning folders for symlinks in /Users/edz/Documents/mix-lab/node_modules (13ms)
    Found Xcode project mixlab.xcodeproj

Could not find iPhone 6 simulator

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mixlab@0.0.1 dev-ios: `react-native run-ios`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mixlab@0.0.1 dev-ios script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/edz/.npm/_logs/2019-05-17T03_35_20_090Z-debug.log
上午11:35:20 - Compilation complete. Watching for file changes.


上午11:35:20 - File change detected. Starting incremental compilation...


上午11:35:21 - Compilation complete. Watching for file changes.
  • 进入项目工程目录下(找到这个findMatchingSimulator.js 并修改)
  • /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js
/* 修改 simulators 的判断*/
if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
      continue;
    }
/*修改成如下*/
if (!version.includes('iOS')) {
      continue;
    }
需要修改的位置如下

重新 react-native run-ios即可

参考链接 https://stackoverflow.com/questions/52783369

上一篇下一篇

猜你喜欢

热点阅读