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

你可能感兴趣的:(React Native运行出现Could not find "iPhone X" simulator)