feat: launch emulator during run-android#676
feat: launch emulator during run-android#676thymikee merged 10 commits intoreact-native-community:masterfrom
Conversation
packages/platform-android/src/commands/runAndroid/tryLaunchEmulator.ts
Outdated
Show resolved
Hide resolved
packages/platform-android/src/commands/runAndroid/runOnAllDevices.ts
Outdated
Show resolved
Hide resolved
packages/platform-android/src/commands/runAndroid/runOnAllDevices.ts
Outdated
Show resolved
Hide resolved
packages/platform-android/src/commands/runAndroid/tryLaunchEmulator.ts
Outdated
Show resolved
Hide resolved
packages/platform-android/src/commands/runAndroid/tryLaunchEmulator.ts
Outdated
Show resolved
Hide resolved
packages/platform-android/src/commands/runAndroid/tryLaunchEmulator.ts
Outdated
Show resolved
Hide resolved
packages/platform-android/src/commands/runAndroid/tryLaunchEmulator.ts
Outdated
Show resolved
Hide resolved
packages/platform-android/src/commands/runAndroid/tryLaunchEmulator.ts
Outdated
Show resolved
Hide resolved
|
Something that bothers me, there is no point in declaring a function as async just to await its return, you are just overwrapping stuff as it already returns a promise. |
|
Thanks, @Titozzz :) It was redundant, fixes. |
thymikee
left a comment
There was a problem hiding this comment.
Last batches of adjustments and I think we're good :)
I wonder if we're able to come up with Genymotion (or other custom emulators I don't know of) support as a followup.
packages/platform-android/src/commands/runAndroid/tryLaunchEmulator.ts
Outdated
Show resolved
Hide resolved
bc7f1f2 to
ba53509
Compare
thymikee
left a comment
There was a problem hiding this comment.
Still need to test it, but code-wise LGTM 👍 great work @jaysbytes
|
cc @satya164 would you like to give it a try? :) |
Co-Authored-By: Michał Pierzchała <thymikee@gmail.com>
d6ea811 to
20bdb48
Compare
|
Just tested locally and fixed a bug I encountered. Also adjusted the wording around errors, warnings and infos a bit. Once CI is happy, this is good to go |
|
@thymikee thanks for the help with shipping of this awesome feature 😀 |
|
Wouldn't it be better if available emulators are shown and asked to select one? |
|
@a-c-sreedhar-reddy not sure about that. Current behavior matches what we do for iOS. Maybe it's worth to revisit. Can you please create a proposal for that where we can discuss better UX? |
|
Has this feature been included in a recent release? I didn't see it mentioned in any of the latest release notes |
|
@jsjoeio Yes. It's available in the latest release. C:\Users\Shan7anu\Desktop\RNProjects\Sample>react-native run-android |
|
Woohoo! Thanks for confirming @Shan7anu! |
|
hello @jayu thanks for adding this feature. unfortunately i seem to be unable to get this to work. for context, android studio is not running at the time i run expected behavior:
actual behavior:
alternatively, i opened up android studio. emulator has not launched yet. i run
actual behavior:
workaround: |
I'm using Linux Mint and getting a similar error |
Summary:
This PR resolves #142
TLDR;
During
react-native run-androidthe first of user's emulators will be launched if there is no any running android device/emulatoremulator -list-advsto get a list of emulatorsemulator @FIRST_ON_LISTto run the first available emulatorTest Plan:
react-native run-androidwithout launched emulator -> emulator is launchingreact-native run-androidwith launched emulator -> nothing new happensreact-native run-androidwith device connected -> nothing new happensreact-native run-androidwithout launched emulator, emulator has saved snapshot -> emulator is launching