android模拟器不显示应用程序

时间:2016-05-26 09:09:07

标签: android cordova android-emulator phonegap-build phonegap-cli

我安装了phonegap cli和android sdk cli。 我尝试使用默认参数创建一个新项目:     phonegap创建-n-name“mypoc”--id“com.cavissima.poc” - 模板hello-world

之后我添加了android平台进行测试:

phonegap platform add android

最后我尝试在Android模拟器上启动它:

phonegap run android --verbose

在命令行中我看到这个动作有很多循环:

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

当最终的android模拟正在显示我无法在其中找到我的应用程序。如果它 注意:当试图在模拟器搜索应用程序部分中键入一些文本时,android运行真的很重要:显示每个字符需要3秒钟...

当我停止模拟器时,我可以在命令行部分看到:

    Error: CordovaError: Failed to execute shell command "getprop,emu.uuid"" on device: Error: C:\Users\pvali\AppData\Local\Android\android-sdk\platform-tools\adb.exe: Command failed with exit code 4294967295 Error output:
error: protocol fault (couldn't read status): No error
    at d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\lib\Adb.js:82:25
    at _rejected (d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\node_modules\q\q.js:844:24)
    at d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\node_modules\q\q.js:870:30
    at Promise.when (d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\node_modules\q\q.js:1122:31)
    at Promise.promise.promiseDispatch (d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\node_modules\q\q.js:788:41)
    at d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\node_modules\q\q.js:604:44
    at runSingle (d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\node_modules\q\q.js:137:13)
    at flush (d:\Projets\cavi\mobileapp\POC\mypoc\platforms\android\cordova\node_modules\q\q.js:125:13)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)

可以帮助设置的android avd的选项是: emulator description

1 个答案:

答案 0 :(得分:0)

抱歉,我没有足够的评论意见,所以我不知道应该去哪里,但这通常发生在我重新启动后第一次运行模拟器时。

模拟器不显示应用程序,因为基于错误Running command "getprop emu.uuid" on emulator-5554...,它无法在模拟器中定义必需的属性。

因此,它无法继续构建,部署应用程序并将其安装到模拟器。

假设www文件夹中没有任何更改,请关闭您的模拟器,请尝试以下操作:

  1. phonegap build android --verbose
  2. 确认应用程序是否确实构建没有错误。

    1. phonegap run android --verbose
    2. 此时,您将看到在加载模拟器时看到的内容Running command "getprop emu.uuid" on emulator-5554...

      如果主屏幕加载后没有任何反应,Ctrl + C将其停止。然后在不关闭模拟器的情况下,再次输入以下命令。

      1. phonegap run android --verbose
      2. 你应该看不到 Running command "getprop emu.uuid" on emulator-5554... 相反,你应该看到Running comand "cat /proc/cpuinfo" on emulator-5554...

        如果没问题,您应该能够通过CLI观察已经开始在模拟器上构建和安装。

        PS。我建议您检查Snapshot中的Use Host GPUEmulation Options,以便为您的模拟器提供支持。要了解哪一个适合您的开发,请参考此处:

        https://android.stackexchange.com/questions/51739/what-is-snapshot-and-use-host-gpu-emulation-options-for

相关问题