Running phonegap on device - no device found

前端 未结 14 1688
孤独总比滥情好
孤独总比滥情好 2021-01-30 02:27

I am trying to run an app that I made in phonegap on my device, connected with USB.

-> phonegap run android
[phonegap] detecting Android SDK environment...
[p         


        
相关标签:
14条回答
  • 2021-01-30 03:00

    I was having this same problem on an LG Optimus phone; adb reported that the device was there, but cordova run android --device failed with "Failed to deploy to device; no devices found". Turns out that of the four connection modes available on the phone:

    • Charge phone
    • Media sync (PTP)
    • Internet connection
    • Camera (PTP)

    The only one that works is Internet connection -> Modem

    Hope this saves someone some hair-tearing. :)

    0 讨论(0)
  • 2021-01-30 03:03

    What worked for me was changing the device from a media device to camera in the USB settings.

    USB computer connection (Camera).png

    0 讨论(0)
  • 2021-01-30 03:03

    If you have only one device attached, phonegap run android --device is enough.

    0 讨论(0)
  • 2021-01-30 03:06

    On windows I needed to install device drivers for my phone (Moto G) from the Motorola site. Updating the SDK, Google USB drivers etc didn't make any difference; every time I did adb devices there was nothing shown.

    After I installed the Motorola drivers locally the device showed up.

    0 讨论(0)
  • 2021-01-30 03:08

    I had this same issue but for a different reason. Here's how I solved it...

    1. Installed Google USB Driver
    2. Installed Samsung USB Driver
    3. Updated my Android SDK Platform-tools (Android SDK Manager)
    4. Edited Widget ID in config.xml to something different. <-- Finally solved it.

    Working on the same project from two machines could cause a conflict when installing the app from the second machine. Either uninstall the app from the phone and fresh install or change the widget ID. Hope this helps someone, the PhoneGap CLI doesn't explicitly give an error telling this.

    0 讨论(0)
  • 2021-01-30 03:10

    I had similar problem. I cloned code from git and the phonegapp did not install app in my device (LG Nexus 4). But I had another app installed in my phone with the same name and ID of the app that I was trying to install.

    Removing the old app from my phone solved this problem to me.

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