android emulator doesn't display app

拥有回忆 提交于 2019-12-23 02:22:18

问题


I installed phonegap cli and and android sdk cli. I tried to create a new project with default parameter : phonegap create -n-name "mypoc" --id "com.cavissima.poc" --template hello-world

after what i added android platform for testing :

phonegap platform add android

And finally i tried to launch it on android emulator :

phonegap run android --verbose

in the command line i see a lot of loop on this action:

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

when finaly the android emulated is displying i can't find my app in it.if it note: the android run realy when trying to type some text in the emulator search app section : it takes 3 seconds to display each character...

When i stop the emulator i can see this in the command line section:

    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)

can help the option of the android avd i setted up are: emulator description


回答1:


Sorry, I don't have enough points to comment, so I am not sure where this should go but this usually happens to me as well on my first run of the emulator after a reboot.

The emulator doesn't display the app because based on the error Running command "getprop emu.uuid" on emulator-5554... it wasn't able to define a required property in the emulator.

Thus, it wasn't able to proceed to build, deploy and install the application to the emulator.

Assuming that nothing is changed in the www folder, close your emulator and please try the following:

  1. phonegap build android --verbose

Confirm whether the app really does build without error.

  1. phonegap run android --verbose

At this point, you will see what you saw Running command "getprop emu.uuid" on emulator-5554... as it loads the emulator.

If nothing happens after the home screen loads, Ctrl + C to stop it. Then without closing the emulator, enter the following command again.

  1. phonegap run android --verbose

You should not be able to see Running command "getprop emu.uuid" on emulator-5554... instead you should see Running comand "cat /proc/cpuinfo" on emulator-5554...

If it's okay, you should be able to observe through the CLI that the has started to build and install on the emulator.

PS. I recommend that you check either Snapshot or Use Host GPU in the Emulation Options in order to give your emulator a boost. To know which one suits your development, please refer here:

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



来源:https://stackoverflow.com/questions/37456371/android-emulator-doesnt-display-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!