add new CLI feature for selecting target device#3534
add new CLI feature for selecting target device#3534esthor wants to merge 6 commits intofacebook:mainfrom
Conversation
|
Hi @esthor! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✅ Deploy Preview for react-native ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
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. 🤷