add new CLI feature for selecting target device #3534
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.
What: There is a new
--list-devicesflag being added to the React Native CLI that provides an interactive list of available devices (for both iOS and Android). It's very nice.Why: TL;DR: Convenience & ✨✨ Developer Experience ✨✨
This interactive approach allows a user to not need to manually run
xcrun simctl list devicesoradb devicesin order to copy and then paste the exact device name into a--simulator <simulator_name>or--deviceID <device_id>, for iOS and Android, respectively.Status: Besides approval on this PR, these changes need to land over in React Native CLI land:
run-ios --list-devicesreact-native-community/cli#1676Not In Scope
Consolidating the docs around running on devices and simulators/emulators.
I noticed that there are at least 3 few places mentioning how to run (Environment Setup, Running on Device, Running on iOS Simulator), but it doesn't feel like there is a definitive place or pattern to the docs. For instance, that third location is a specific iOS guide for running on specific devices/simulators, but there isn't a similar page in the Android guide on the same topic.
Suggestion:
npx react-native run-android --list-devicesand select the connected device or emulator you'd prefer. For more information, check the Page", which would also have the (old) manual steps.I may also be hyper-focused on this topic and it's maybe not that big of a deal. 🤷