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

fix: correctly list ios devices and simulators #1863

Merged
merged 3 commits into from
Mar 12, 2023
Merged

fix: correctly list ios devices and simulators #1863

merged 3 commits into from
Mar 12, 2023

Conversation

roryf
Copy link

@roryf roryf commented Mar 8, 2023

Summary:

Backports #1823 to 10.x branch.

After updating to RN 0.71.3 I was experiencing issue similar to #1807 (it would try to use my laptop as target device), hoping this can be merged to a 10.x release and fixed in a new RN 0.71.x version.

Fixes #1845

Test Plan:

> node ../cli/packages/cli/build/bin.js run-ios --list-devices            
warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
info Found Xcode workspace "Foo.xcworkspace"
? Select the device you want to use › - Use arrow-keys. Return to submit.
❯   iPhone 12 mini 
    iPhone 8 Plus 
    iPad (10th generation) 
    iPhone 11 
    iPhone 13 
    iPhone SE (3rd generation) 
    iPod touch (7th generation) 
    iPhone 14 
    iPhone 14 Pro 
  ↓ iPhone 12 Pro

@roryf roryf requested review from adamTrz and thymikee as code owners March 8, 2023 22:48
@github-actions github-actions bot added bugfix docs Documentation change labels Mar 8, 2023
@roryf roryf changed the title Fix list ios devices fix: correctly list ios devices and simulators Mar 8, 2023
@adamTrz
Copy link
Collaborator

adamTrz commented Mar 9, 2023

Thanks for the PR @roryf 🎉

Could you please resolve failing test? And then we can merge :)

@roryf
Copy link
Author

roryf commented Mar 9, 2023

@adamTrz should be resolved now

@adamTrz adamTrz merged commit 8dcde34 into react-native-community:10.x Mar 12, 2023
@roryf
Copy link
Author

roryf commented Mar 12, 2023

@adamTrz @thymikee thanks for merging, can a new 10.x release be cut?

@roryf roryf deleted the fix-list-ios-devices branch March 13, 2023 10:05
@thymikee
Copy link
Member

thymikee commented Mar 15, 2023

hey @roryf, I've released these packages:

 - @react-native-community/cli-doctor@10.2.1
 - @react-native-community/cli-platform-ios@10.2.1
 - @react-native-community/cli@10.2.1

They won't be automatically pulled by the RN 0.71, so we'd need to send a request to update the CLI

EDIT: sent: reactwg/react-native-releases#59

@lucasbento
Copy link
Member

@thymikee @szymonrybczak @roryf could we potentially make this the default behaviour in case it fails to run run-ios on the first picked device? Basically prompt the user for selecting the device if it failed the first time.

Asking as the command seems to be defaulting to my Apple Watch (something to look into as well, I would be happy to do it) and might default to my physical device which will potentially fail as well as it's sometimes not in the same network.

@thrandale
Copy link

I am also seeing where it is picking my apple watch instead of my phone. And failing because of it
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix docs Documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants