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

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!

About this issue

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

Most upvoted comments

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.

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.

The version I use is below. Cordova CLI 9 Cordova Android 8.1.0-nightly.2019.3.31.9531dbbc Android Emulator 28.0.25 Android SDK Platform-Tools 28.0.2 Intel x86 Emulator Accelerator(HAXM installer) 7.3.2 Emulated Performance Setting for AVD :

  • Graphics Hardware - GLES 2.0
  • Boot option Cold boot

in my case, I did the following and the problem disappeared. But I don’t know if this has any obvious effect.

  1. connect pc with real android phone and run cordova.(“cordova run android”). i use galaxy note5.
  2. disconnect the phone and type “cordova run android” for run avd.
  3. avd run successful.

yeah, it just plug and play. but hope this will help.