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

feat(run-ios): allow passing UDID inside --device option #2375

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

szymonrybczak
Copy link
Collaborator

Summary:

We have bunch of options to provide a target to run app on:
--device,
--simulator,
--udid.

It creates some misconception for users, where one flag works as expected in theory but user think that it's not working since they may don't know about other options.

In this Pull Request I've improved experience of using --device flag in run-ios function (I'll add run-android implementation in separate Pull Request). From now --device accepts device name and unique device identifier and also checks if target device is maybe a simulator to give an appropriate error message to guide user what they should use.

Test Plan:

  1. Clone the repository and do all the required steps from the Contributing guide
  2. This command
node /path/to/react-native-cli/packages/cli/build/bin.js run-ios --device "iPhone Szymon"

should run app on physical device.
3. This command

node /path/to/react-native-cli/packages/cli/build/bin.js run-ios --device "XYZ-UDID-PHYSICAL"

should run app also on physical device (the same behaviour as with device name).
4. This command (iPhone 15 is a simulator)

node /path/to/react-native-cli/packages/cli/build/bin.js run-ios --device "iPhone 15"

should throw the error:
5. This command ("XYZ-UDID-SIMULATOR" is a simulator's UDID)

node /path/to/react-native-cli/packages/cli/build/bin.js run-ios --device "XYZ-UDID-SIMULATOR"

should also throw the error:

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

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

Successfully merging this pull request may close these issues.

None yet

1 participant