最近原来的老项目有点问题需要处理一下,运行启动命令,就报了如下错误,提示找不到iPhone 6 模拟器。

react-native run-ios

Owaiss-Mac:pdm owaisahmed$ react-native run-ios
Found Xcode project pdm.xcodeproj Could not find iPhone 6 simulator Error: Could not find iPhone 6 simulator
at resolve (/Users/fantuan/Documents/react-native-projects/pdm/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
at new Promise (<anonymous>)
at runOnSimulator (/Users/fantuan/Documents/react-native-projects/pdm/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
at Object.runIOS [as func] (/Users/fantuan/Documents/react-native-projects/pdm/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
at Promise.resolve.then (/Users/fantuan/Documents/react-native-projects/pdm/node_modules/react-native/local-cli/cliEntry.js:117:22)

老项目是一年前的当时项目的的版本时还是0.57,期间工作电脑的系统版本升级到了10.14.6, XCode的版本也升级到了10.3,使用如下命令可以查看当前项目的具体环境信息:

React Native Environment Info:
System:
OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Memory: 26.40 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.14.1 - ~/.nvm/versions/node/v10.14.1/bin/node
Yarn: 1.13.0 - ~/.nvm/versions/node/v10.14.1/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.14.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 23, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.3, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.2
System Images: android-23 | Intel x86 Atom, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4720617
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.0 => 0.57.0
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-create-library: 3.1.2

经过一番查阅资料发现是Xcode的版本升级到10导致的。

解决方案如下:

1.打开项目node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js文件

2.修改文件的第31行

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

为如下代码

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

吐血注意:

对于ReactNative项目开发中,请不要轻易升级Xcode等编译,除非你十分精通。

欢迎大家关注我的公众号:君伟说,定期推送开发技术。

Could not find iPhone 6 simulator的更多相关文章

  1. Could not find iPhone X simulator

    Could not find iPhone X simulator Error: Could not find iPhone X simulator at resolve (/Users/zhouen ...

  2. react-native run-ios “Could not find iPhone X simulator”

    问题 这个问题发生在旧的RN版本(0.57,0.58(<0.58.4),-)和Xcode 10.3中,其中可用模拟器的名称得到了一些调整 在文件node_modules/@react nativ ...

  3. 【js】react-native Could not find iPhone 6 simulator 和 Entry, ":CFBundleIdentifier", Does Not Exist 两种报错解决办法

    一.在运行rn app应用时,react-native run:ios 报错出现   Could not find iPhone 6 simulator  解决办法: 1.react-native r ...

  4. React Native运行出现Could not find "iPhone X" simulator

    打开项目文件夹下 node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 查找 if (!version.startsW ...

  5. REMOVE ONCLICK DELAY ON WEBKIT FOR IPHONE

    Developing on the webkit for iPhone I encountered a curious delay ononClick events. It seems that th ...

  6. Xamarin.Forms介绍

    On May 28, 2014, Xamarin introduced Xamarin.Forms, which allows you to write user-interface code tha ...

  7. A Xamarin.Forms Infinite Scrolling ListView

    from:http://www.codenutz.com/lac09-xamarin-forms-infinite-scrolling-listview/ The last few months ha ...

  8. Scott Hanselman's 2014 Ultimate Developer and Power Users Tool List for Windows -摘自网络

    Everyone collects utilities, and most folks have a list of a few that they feel are indispensable.  ...

  9. iOS开发中使用静态库 .a 文件

    ​​iOS开发中,在使用一些第三方库时,可能是一个静态库(比如GPUImage).这种情况下,需要编译出静态库文件(.a) ,然后配合响应的头文件(.h 文件)使用. 编译静态库,直接在Xcode中编 ...

随机推荐

  1. H3C 帧中继基本概念

  2. centos linux mysql 10060远程错误代码

    Navicat for MySQL远程连接数据错误代码10060 1.登陆远程linux服务器命令界面 vim /etc/sysconfig/iptables  进入防火墙配置修改 增加以下两条防火墙 ...

  3. uni-app 生命周期函数

    应用生命周期 函数名 说明 onLaunch 当uni-app 初始化完成时触发(全局只触发一次) onShow 当 uni-app 启动,或从后台进入前台显示 onHide 当 uni-app 从前 ...

  4. Scrap简介

    原文:https://blog.csdn.net/ssw_1990/article/details/51254227 提到Python与网络爬虫,可能会想到urllib,urllib2,Beautif ...

  5. H5 新增表单属性和事件

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. P1077 子串乘积正负分类

    题目描述 给你一个序列包含 \(n\) 个元素的序列 \(a_1, a_2, \dots , a_n\) (每个元素 \(a_i \ne 0\)). 你需要计算如下两个值: 有多少对数 \((l, r ...

  7. 20191029校内ACM部分题解

    20191029校内ACM部分题解 https://codeforces.com/group/32W4q7bPme/contest/257710 B数学 给定一个在\([0,1]\)等概率随机区间的随 ...

  8. 2019-5-21-win10-uwp-商业游戏-1.1.5

    title author date CreateTime categories win10 uwp 商业游戏 1.1.5 lindexi 2019-05-21 11:38:20 +0800 2018- ...

  9. Linux 内核 /sys/class类

    我们在本章中要考察最后的设备模型概念是类.一个类是一个设备的高级视图, 它抽象出 低级的实现细节. 驱动可以见到一个 SCSI 磁盘或者一个 ATA 磁盘, 在类的级别, 它们都 是磁盘. 类允许用户 ...

  10. substring和substr的区别和使用

    第一反应是都是截取字符串的方法,好像平常使用的时候也没太注意区分这俩,今天看到正好来区分一下 substring(start,[end]) 如果省略end,那么截取的是从指定位置到末尾 var str ...