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

打开项目文件夹下 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'))

查找

simulator.isAvailable !== 'YES'

修改为

if (simulator.isAvailable !== true)

原方法地址 https://github.com/facebook/react-native/issues/21498#issuecomment-476621627

posted @ 2020-01-16 15:12  至尊王者  阅读(1199)  评论(0编辑  收藏  举报