Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse simulator list #23293

Merged
merged 1 commit into from
Feb 5, 2019
Merged

Conversation

osunnarvik
Copy link

@osunnarvik osunnarvik commented Feb 5, 2019

Summary

When parsing simulator names in order to run on iOS simulator, the name now contains the prefix "com.apple.CoreSimulator.SimRuntime." Therefore the check to filter out simulators that are not iOS or tvOS needs not to check for startsWith, but rather to check for includes.
Without the fix, I am not able to start and run the iOS simulator through the react-native cli

This started happening for me after I installed the latest XCode (beta). I am currently using XCode "Version 10.2 beta (10P82s)", but I have tried using xcode-select to point towards the latest stable XCode version as well, but the problem still occurs. My version of xcrun is "xcrun version 43.1."

Changelog

[iOS] [Changed]- Enabling start of iOS/tvOS simulators when simulator versions are reported with apple-prefixes.

Test Plan

Run the command react-native run-ios. Without the fix I get the error
Could not find iPhone X simulator
With the fix, it starts fine.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 5, 2019
@pull-bot
Copy link

pull-bot commented Feb 5, 2019

Warnings
⚠️

🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

⚠️

📋 Release Notes - This PR appears to be missing Release Notes.

⚠️

❗ Big PR - This PR is extremely unlikely to get reviewed because it touches 4956 lines.

Generated by 🚫 dangerJS

@osunnarvik osunnarvik changed the base branch from master to 0.58-stable February 5, 2019 13:07
@osunnarvik
Copy link
Author

As master obviously is not in sync with latest stable, I made this pull request towards 0.58-stable. Should probably be towards the lastest development branch, but it was not obvious to me which one that should be. Feel free to change the target of the PR.

@cpojer cpojer changed the base branch from 0.58-stable to master February 5, 2019 14:28
@cpojer cpojer changed the base branch from master to 0.58-stable February 5, 2019 14:28
@osunnarvik
Copy link
Author

osunnarvik commented Feb 5, 2019

For reference.. Here is what the output from xcrun simctl list --json devices looks like (copied out example just from the iOS (12.2) simulators):

    "com.apple.CoreSimulator.SimRuntime.iOS-12-2" : [
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 5s",
        "udid" : "E57D975D-4D52-4BFE-9946-A03CB56A98CD",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6",
        "udid" : "EE0AD5E8-CB7A-495C-82ED-1B876D530D9E",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6 Plus",
        "udid" : "7240C89E-CEB3-45B0-9941-903EF96A97C3",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6s",
        "udid" : "B2E798F4-2DB6-4B13-B434-A4B964061545",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 6s Plus",
        "udid" : "89D84E6B-4400-4E5B-B653-68E53AEDD6BB",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 7",
        "udid" : "9B7FB56A-88F8-4D33-BC56-472F52B20485",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 7 Plus",
        "udid" : "B1C3E943-21AB-4F61-94C8-2321306296FF",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 8",
        "udid" : "19D4A1BB-29BF-4B96-9384-48EBEC7C74F8",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone 8 Plus",
        "udid" : "CC87B686-3DBB-4ADF-9421-3FEE948087DE",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone SE",
        "udid" : "F2D502D8-FEBD-4E58-8285-55A4D258521A",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Booted",
        "isAvailable" : true,
        "name" : "iPhone X",
        "udid" : "4D9E6A35-6DB5-4FDC-B054-C8729CA87218",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xs",
        "udid" : "065B59F0-945C-45B0-9FF9-145ACCEF30BB",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xs Max",
        "udid" : "14613656-5F78-47EC-A53D-6A443F2856DE",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xʀ",
        "udid" : "4D54A311-EC97-44A1-8CF2-94B1686C4FD3",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Air",
        "udid" : "5F59D328-111D-4A20-BC1C-D661C68C7988",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Air 2",
        "udid" : "BEA0F58F-EFE2-4131-9CBB-E98C84C39E2C",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad (5th generation)",
        "udid" : "62002A8D-76DF-4355-BC5C-70B169A4B71D",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (9.7-inch)",
        "udid" : "829DD371-6A9B-4FBA-9561-6CA124635770",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch)",
        "udid" : "7D750978-373D-4F62-BC15-BFBDA4F75B65",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch) (2nd generation)",
        "udid" : "70D65152-905F-41DF-881D-0CF9512E1FC3",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (10.5-inch)",
        "udid" : "DE303370-416A-4B80-B0A0-83F0CF346D0A",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad (6th generation)",
        "udid" : "B4E903DA-1D5E-4004-891F-C08D0CC9DEEB",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (11-inch)",
        "udid" : "741202BC-6CAD-4BDC-8434-AEC49660ABBD",
        "availabilityError" : ""
      },
      {
        "availability" : "(available)",
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPad Pro (12.9-inch) (3rd generation)",
        "udid" : "BED12476-8111-447C-89B6-254459487A13",
        "availabilityError" : ""
      }
    ],

@cpojer cpojer merged commit 98bcfe0 into facebook:0.58-stable Feb 5, 2019
@osunnarvik osunnarvik deleted the parse_simulator_list branch February 5, 2019 19:17
@jmatsushita
Copy link

Could you please backport to 0.57?

@hramos
Copy link
Contributor

hramos commented May 6, 2019

@jmatsushita we have a separate repo for discussing backports and cherry picks over at http://github.com/react-native-community/react-native-releases

t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants