react-native run-ios can not find any simulator

后端 未结 8 704
滥情空心
滥情空心 2020-12-03 08:07

I have been facing an issue where \'react-native run-ios\' can not start, regardless of the simulator I add to the --simulator argument. XCode has the correct location for t

8条回答
  •  孤城傲影
    2020-12-03 08:53

    Here is additional temporary fix too. I am using Catalina.

    I this file:

    /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js
    

    Change line 42 to:

    if (!version.includes('iOS') && !version.includes('tvOS')) {
    

    Change line 52-53 from:

    simulator.availability !== '(available)' &&
    simulator.isAvailable !== 'YES'
    

    to:

    simulator.isAvailable !== true
    

    because the returned json list from command xcrun simctl list --json devices, the property isAvailable is boolean and didn't have property 'availability'.

提交回复
热议问题