-
Notifications
You must be signed in to change notification settings - Fork 918
run-android with specified emulator name #1038
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
Comments
Sounds great to have this feature. Would be symmetric to |
Properly installed Android environment comes with
|
@krizzu we are already using an The problem is we need to be able to run an app on the already booted emulator. To do this, we have to know which of The perfect solution would be if |
You could run In my case,
|
Yes, that was exactly my plan! Maybe I didn't describe it clear enough 😀 . Now when everything is more or less clear, someone could pick this issue ✨ |
Well, seems like I could give it a go then 😄 edit: I get that back, that's not how this should be handled 😆 Going with "possible implementation"! |
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Describe the Feature
be able to run
react-native run-android --emulator MyEmulatorName
After shipping #676 we are able to start an android emulator during
run-android
.Cli will start a new emulator if there isn't any device available. The drawback of the current solution is that it tries to start the first emulator from the list returned by
emulator -list-avds
. It would be usefull to be able to run the app on a specific emulator, even if there are other devices connected. It could work similarly to thedeviceId
flag. We could add anemulator
flag followed with the emulator name.Possible Implementations
This implementation has several edge cases worth discussing, but we will need the following to achieve the goal
Get the emulator names based on
deviceId
adb.getDevices
implemented inrun-android
to get list of currently running devicesdeviceIds
with patternemulator-PORT_NUMBER
deviceIds
to emulator names usingadb -s emulator-PORT_NUMBER emu avd name
Modify
tryLauchEmulator
to accept the emulator name as a paramThen if an emulator is running, launch the app using
tryLaunchAppOnDevice
If the emulator is not running, lunch it and then check once again for
adb.devices
to get it's deviceId, thentryLaunchAppOnDevice
Related Issues
The text was updated successfully, but these errors were encountered: