question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'cordova run android --emulator' command line tool stuck at 'Waiting for emulator to start...'

See original GitHub issue

OS: Windows 10 Cordova: 9.0.0 ADB: Android Debug Bridge version 1.0.40, Version 28.0.2-5303910 Emulator API version: Oreo | 27 | x86 | Android 8.1 (Google APIs)

I’ve installed cordova and am using it to develop an android app. I have all the SDK tools installed.

I’m running into an issue where I cannot start the emulator form the command line. I see there are a lot of posts about this already, but none really answer the problem or include verbose command line output.

Here is the command line output from the command cordova run android --emulator --verbose. I call this command from the /platforms/android/ directory in my project.

Waiting for emulator to start...
Running adb shell command "getprop dev.bootcomplete" on target emulator-5584...
Running command: adb -s emulator-5584 shell getprop dev.bootcomplete
Command finished with error code 1: adb -s,emulator-5584,shell,getprop,dev.bootcomplete
Running adb shell command "getprop dev.bootcomplete" on target emulator-5584...
Running command: adb -s emulator-5584 shell getprop dev.bootcomplete
Command finished with error code 1: adb -s,emulator-5584,shell,getprop,dev.bootcomplete
Running adb shell command "getprop dev.bootcomplete" on target emulator-5584...
Running command: adb -s emulator-5584 shell getprop dev.bootcomplete
Command finished with error code 1: adb -s,emulator-5584,shell,getprop,dev.bootcomplete

And then it just keeps looping… So it seems it be an issue with cordova running the adb command. I’m not 100% sure what the steps would be to fix this.

Current Workaround

I have a workaround that just requires me to run the emulator from the Android Studio AVD Manager and then run

cordova emulate android 

which runs the app on the emulator.

I’d like to get the command line tool working because it will speed up my productivity.

Any help would be greatly appreciated!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
breautekcommented, Oct 14, 2019

I just seen this issue trying to use the emulator. Closing it and opening it did not fix it, however restarting the emulator by using the emulator power option to actually “shut down” android did fix it for me.

I’m not sure the exact cause of it, but I usually close the emulator without actually shutting it down, so perhaps it has something to do with that.

1reaction
breautekcommented, May 21, 2020

I’ve been running into this issue about every 20 minutes… I have my local copy usng sys.boot_completed for now.

Later tonight I’ll test the sys.boot_completed prop on each simulator provided by the android sdk. If that prop exists on each simulator, I’ll make a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cordova - CMD stuck on "Waiting for emulator..." - Stack Overflow
Simply turn the emulated device off by holding the On/Off button until android asks for "Power off". After the shutdown you try booting...
Read more >
Cordova – CMD stuck on “Waiting for emulator…” - iTecNote
Go to the Android SDK platform-tools directory in the command prompt; Type adb kill-server (Eclipse should be closed before issuing these commands); Then...
Read more >
Stuck at waiting for Emulator - Visual Studio Feedback
It looks like from the output of the build, that it gets stuck running this command over and over again: 2>Command finished with...
Read more >
Waiting for emulator to start... | Quasar Framework Community
Make sure the emulator being tried is installed. · Assuming that emulator is there and runs in the SDK… · From the src-cordova\platforms\android...
Read more >
Cordova emulate android error, Cordova debug Android emulator ...
Cordova stuck on Waiting for emulator to start. Start Emulator emulator.exe -avd *avdname* in cmd (wait for few minutes for full start up)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found