react-native run-ios 找不到 simulator 解决方案

在尝试运行react-native应用时遇到run-ios找不到iPhone X simulator的错误。解决方案是根据本地安装的simulator版本修改配置。建议在修改前先通过命令打印simulator列表以确定正确版本。
摘要由CSDN通过智能技术生成
实际问题

react-native run-ios 脚本却会抛出如下错误:

Could not find iPhone X simulator

在网上也能找到一些解决方案,比如下面这个:

react-native run-ios returns Error: Could not find iPhone X simulator

上面文章的解决方案是将 /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 中的

// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
    continue;
}

改为

// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
if (!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvO
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值