react-native run-ios can not find any simulator

后端 未结 8 645
滥情空心
滥情空心 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 09:14

    Update

    It is fixed in v1.9.8.

    Update cli is the easy solution

    npm install -g react-native-cli@latest
    

    This issue is fixed but not released yet. https://github.com/react-native-community/react-native-cli/pull/274

    So it can be solved temporarily to fix the file below.

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

    Change this line

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

    to

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

    Do not forget apply this again when you reinstall packages.

    0 讨论(0)
  • 2020-12-03 09:14

    I've found a temporary fix:

    In the following file:

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

    ...change line 42 to:

    if (!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('tvOS')) {
    
    0 讨论(0)
提交回复
热议问题