问题

这个问题发生在旧的RN版本(0.57,0.58(<0.58.4),…)和Xcode 10.3中,其中可用模拟器的名称得到了一些调整 在文件node_modules/@react native community/cli/build/commands/runIOS/findMatchingSimulator.js中,react native尝试通过简单的.startsWith检查选择正确的模拟器。由于重命名,检查现在应该使用.includes(ref)

Found Xcode project appupdateDemo.xcodeproj

Could not find iPhone X simulator

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

解决方案

  1. 跟新你的RN版本到0.58.4 +
  2. 如果您无法或不会升级到新的RN版本,则可以使用以下命令自动调整findMatchingSimulator.js文件:
sed -i '' 's/startsWith/includes/g' node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

用这个命令就不用我们去node_modules下面手动修改源码了

还可以把这个命令 放到package.json 的 script节点下面 指定命令 然后用npm run xx 直接执行这个命令 这样用起来更方便一些

{
"name": "appupdateDemo",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"fixOldRnVersion": "sed -i '' 's/startsWith/includes/g' node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js"
},
"dependencies": {
"react": "16.6.1",
"react-native": "0.57.7",
"rn-app-upgrade": "^1.0.4"
},
"devDependencies": {
"babel-jest": "24.9.0",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.57.0",
"react-test-renderer": "16.6.1"
},
"jest": {
"preset": "react-native"
}
}
[topbrids@topdeMacBook-Pro appupdateDemo]$ npm run fixOldRnVersion

> appupdateDemo@0.0.1 fixOldRnVersion /Users/topbrids/rn_share_pro/appupdateDemo
> sed -i '' 's/startsWith/includes/g' node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

react-native run-ios “Could not find iPhone X simulator”的更多相关文章

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

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

  2. React Native & Android & iOS & APK

    React Native & Android & iOS & APK https://play.google.com/apps/publish/signup/ $ 25 bui ...

  3. React Native & Android & iOS

    React Native & Android & iOS React Native & Android & iOS https://facebook.github.io ...

  4. React Native (二) ios打包到真机

    每当在模拟器上完成了开发,都想到真机上试试,正好前段时候淘了一个imac. 这里就以打包rndemo到iphone为例,讲一下react ntive ios打包到真机的流程. 一.前置 1.有个iph ...

  5. React Native视频播放(iOS)

    网站链接:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/learn-react-native-video/ React Nativ ...

  6. [React Native] Basic iOS Routing -- NavigatorIOS

    Inside the app component, we use NavigatiorIOS to render the compoent: class githubnotetaker extends ...

  7. React Native(十三)——ios键盘挡住textInput

    渐入佳境 用React Native重构的项目也快接近尾声,剩下的就是适配ios的功能了.慢慢地也从中琢磨出了一点门道,于是就遇见了键盘遮挡textInput问题斑斑: 正常页面: android点击 ...

  8. React Native之iOS App打包

    iOS打包步骤(一.二.三可不按照顺序) 步骤一: 选择iOS Device(以下两者选其中一个即可) 选择 Generic iOS Device (个人建议使用这个) 选择Generic iOS D ...

  9. 一个资深iOS开发者对于React Native的看法

    一个资深iOS开发者对于React Native的看法 当我第一次尝试ReactNative的时候,我觉得这只是网页开发者涉足原生移动应用领域的歪门邪道.   我认为一个js开发者可以使用javasc ...

  10. [转] 一个资深iOS开发者对于React Native的看法

    当我第一次尝试ReactNative的时候,我觉得这只是网页开发者涉足原生移动应用领域的歪门邪道. 我认为一个js开发者可以使用javascript来构建iPhone应用确实是一件很酷的事情,但是我很 ...

随机推荐

  1. linux ftp配置及实操

    一.基础知识: 1.ftp:file transfer protocal 及文件传输协,工作与应用层. 2.ftp协议的实现: 服务器端实现软件:vsftpd,pureftpd,filezilla s ...

  2. sqlserver2008 R2 安装以后没有 sql server profiler

    一些人在安装好SQL server 2008 r2或者从empress升级到enterprise或者开发版之后没有SQL server profiler功能,如果需要加装则应该找到自己的安装文件(部分 ...

  3. Intellij 生成exe可执行文件

    生成jar包 编写源代码 此处我使用kotlin来编码,主函数实际功能就是输出一行文字. /** * 应用入口 * @author mazaiting */ object TestExe { ​ @J ...

  4. centos6.7下安装glibc-2.17

    glibc  所有版本下载地址 : http://ftp.gnu.org/pub/gnu/glibc/ 安装先决条件: #yum install gcc libffi-devel python-dev ...

  5. master节点的部署介绍和前置工作

    目录 组件介绍 组件介绍 kubernetes master节点运行组件如下: kube-apiserver.kube-scheduler.kube-controller-manager.kube-n ...

  6. 网页采集器-UA伪装

    网页采集器-UA伪装 UA伪装 请求载体身份标识的伪装: User-Agent: 请求载体身份标识,通过浏览器发起的请求,请求载体为浏览器,则该请求的User-Agent为浏览器的身份标识,如果使用爬 ...

  7. xpath-房价爬取

    xpath xpath两种使用方式 和bs类似,一种是调用本地资源,一种是网络资源 etree.parse(filePath) etree.HTML('page_text') xpath表达式 层级: ...

  8. CSS+HTML实现移动端div左右滑动展示

    由于手机屏幕的宽度有限,内容太多移动设备一行装不下的,所以很多移动端网站的导航栏都有左右滑动效果,下面我就用CSS+HTML实现移动端div左右滑动展示. CSS:box设置文本不换行,子元素box1 ...

  9. 十一次作业——LL(1)文法的判断,递归下降分析程序

    1. 文法 G(S): (1)S -> AB (2)A ->Da|ε (3)B -> cC (4)C -> aADC |ε (5)D -> b|ε 验证文法 G(S)是不 ...

  10. Tensorflow Serving Docker compose 部署服务细节(Ubuntu)

    [摘要] Tensorflow Serving 是tf模型持久化的重要工具,本篇介绍如何通过Docker compose搭建并调试TensorFlow Serving TensorFlow Servi ...