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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章