美文网首页
Could not find iPhone 6 simulato

Could not find iPhone 6 simulato

作者: pengxiaochao | 来源:发表于2019-05-17 11:39 被阅读0次

    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

    相关文章

      网友评论

          本文标题:Could not find iPhone 6 simulato

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