feat(run-ios): allow passing UDID inside --device
option
#2375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inrun-ios
function (I'll addrun-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:
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