我正在尝试在Android上运行一个phonegap应用程序,当我运行命令时
phonegap run android --emulator --verbose
我收到了这个错误
Running command "getprop emu.uuid" on emulator-5554...
我如何解决这个问题,任何想法?我尝试通过命令行和android studio模拟器双手打开它.
我发现如果我在发出run命令之前手动启动AVD,那么我不会收到此错误.另外我发现运行旧版本的android可以解决这个问题.我不确切知道这是怎么发生的.跑窗10.
我在带有qomu的fedora 23上使用cordova的Android 6.0 API Level 23设备上收到此错误.
它将运行cordova emulate android
并且模拟器将显示,但应用程序将无法在模拟器中安装或打开.
我的问题是由cordova试图通过getprop emu.uuid
在adb shell上轮询来等待设备准备好引起的.
getprop emu.uuid
在adb shell中运行没有产生任何结果.查看getprop
可用属性的节目输出dev.bootcomplete
.
我修改了它来修改platform/android/cordova/lib/emulator.js中的以下代码(在215-230行左右)等待dev.bootcomplete
1而不是轮询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; } }) ); }); ...
当您一次运行多个模拟器时,这可能会中断.
看起来问题出在模拟器上.cordova运行emulator -avd
但未emu.uuid
在模拟器中正确设置.
希望这有助于某人.