xcode升级后,报Could not find iPhone

作者: 逸笛 | 来源:发表于2019-07-02 09:07 被阅读4次

Could not find iPhone X simulator
在xcode升级后,使用react native,在run-ios时可能会报错
*Could not find iPhone X simulator
……
这个问题是大部分都是因为升级xcode造成的,不用急着去清缓存、重新npm之类的,直接修改一个文件即可解决问题。
找到 /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js文件
发现这行代码:
if (!version.startsWith('iOS') && !version.startsWith('tvOS'))

修改为:
if (!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS'))

再次run-ios试试,应该可以解决问题。

图片.png

相关文章

网友评论

    本文标题:xcode升级后,报Could not find iPhone

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