ADB commandline Hanging during install (PhoneGap)

后端 未结 6 1991
眼角桃花
眼角桃花 2021-01-04 10:43

My Phonegap app refuses to load onto my Android device (even the HellowWorld default app is refusing to load)

Everything was running just great until today. Here\'s

相关标签:
6条回答
  • 2021-01-04 11:30

    Had the same (original) issue (with cordova / testing on an old device) ie. hang during install.

    Tried running adb install directly from cmd line ...

    adb [-s <deviceID>] install <apk>
    

    ...and same issue so not cordova specific....

    Opened android device monitor (ADM) ...

    ..sdk\tools>monitor

    ..and ran install from cmd line again and saw logcat message saying package was sdk 16 / device was 15...doh!

    So went back to AndroidManifest.xml and changed android:minSdkVersion to 15 and all back to normal again - install worked fine.

    ( Issue arose because I had installed something else which had changed the minSdkVersion and then removed the something else and never reset the minSdkVersion )

    So, possibly device sdk / android version is too low for your build. If not, a look at the ADM logcat output as you initiate the install from the command line might indicate what the issue is.

    0 讨论(0)
  • 2021-01-04 11:32

    The issues seems to resolve itself randomly. As others suggested, an arbitrary combination of ADB kill-server, restarting the device, and re-installing SDKs seems to alleviate the problem (even if only for a couple pushes).

    I still have no idea what causes this hanging and, though superstitiously believe the arbitrary combination described above fixes it, am unsure how to permanently resolve it.

    To future people reading this, until a solid explanation is given my only advice is to square away an hour or so to restart / rebuild your dev environment... and make sure you buy a durable stress ball.

    0 讨论(0)
  • 2021-01-04 11:36

    Do try restart the device like other suggested. From my experience, kill the adb process, then run the cordova run command helps magically sometimes.

    0 讨论(0)
  • 2021-01-04 11:36

    In my case adb seemed to hang, but in fact the data transfer from Mac to emulator was really slow:

    $ adb push platforms/android/build/outputs/apk/android-debug.apk /data/local/tmp/
    150 KB/s (15587200 bytes in 101.223s)
    

    It's a lot faster on USB connected real device. Don't know why...

    0 讨论(0)
  • 2021-01-04 11:39

    Shot in the dark here, but some more things to try:

    1. Are you on a work PC or something? Make sure you have USB write permissions. Also, try different USB ports and cables. You have the latest USB driver for your devices right?
    2. Try updating the SDK tools. Or maybe something got corrupted and a re-install might do the trick.
    3. You have free space on your devices right?
    4. Unknown sources is checked on both devices?
    5. What version of Android are you targeting?
    0 讨论(0)
  • 2021-01-04 11:40

    In case this helps others I had a problem with similar symptoms. ADB install -r "apk path" would hang indefinitely.

    I troubleshooted a myriad of things and identified that it was my USB cable length.

    I have an USB extender cable as that I plug my devices into. The combined length of my device's cable and the USB extender cable caused this issue. Removing the extension cable fix the issue and eventually I replaced my USB extender cable with a shorter extension cable for the final solution.

    0 讨论(0)
提交回复
热议问题