Error starting emulator on Android

I try to run the phonegap application on Android and when I run the command

phonegap run android --emulator --verbose

I get this error

Running command "getprop emu.uuid" on emulator-5554...

How can I fix this, any ideas? I tried to open it both from the command line and with the Android studio emulator.

+5
source share
2 answers

I found that if I manually started AVD before issuing the run command, then I will not get this error. I also found that starting an old version of android solves this problem. I don’t know exactly how this happens. Running windows 10.

+14
source

I was getting this error on an Android 6.0 device level 23 API with a cord on Fedora 23 with qemu.

It will launch cordova emulate android , and the emulator will show, but the application will not be installed or open in the emulator.

My problem was caused by the cordova trying to wait for the device to be ready by polling getprop emu.uuid in the adb shell.

Running getprop emu.uuid in the adb shell did not produce any results. getprop output of getprop shows that the dev.bootcomplete property is dev.bootcomplete .

I fixed it by changing the following code on the /android/cordova/lib/emulator.js platforms (around lines 215-230) to wait for dev.bootcomplete as 1 instead of polling emu.uuid :

 module.exports.wait_for_emulator = function(uuid) { ... new_started.forEach(function (emulator) { promises.push( //Adb.shell(emulator, 'getprop emu.uuid') REMOVE THIS Adb.shell(emulator, 'getprop dev.bootcomplete') .then(function (output) { //if (output.indexOf(uuid) >= 0) { REMOVE THIS if (output == 1) { emulator_id = emulator; } }) ); }); ... 

This may break if you run multiple emulators at the same time.

It seems the problem is with the emulator. cordova starts emulator -avd <device-name> -prop emu.uuid=cordova_emulator_<date> , but emu.uuid incorrectly configured in the emulator.

Hope this helps someone.

+7
source

Source: https://habr.com/ru/post/1246358/


All Articles