Running phonegap on device - no device found

前端 未结 14 1686
孤独总比滥情好
孤独总比滥情好 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 02:55

    If you have only one adb-capable device, use this command:

    phonegap run android --device

    If you have more than one you will need to specify the device ID this way:

    phonegap run android --device=<device-id>

    Example:

    phonegap run android --device=SH25PW103163

    phonegap run android --target=SH25PW103163

    If you want to know the code of a device execute this in the console (shell, terminal):

    adb devices

    0 讨论(0)
  • 2021-01-30 02:57

    Just wanted to share my experience, I wasn't able to launch my cordova app on device. What solved my problem is to upload apk manually:

    adb install -r platforms\android\build\outputs\apk\android-debug.apk
    
    0 讨论(0)
  • 2021-01-30 02:57

    Finally I solved this problem with two ways and I just want to share my experience with you.

    1. I have done all above mentioned and also other ways but it didnt work. So I have deleted all my Virtual Device from Android Studio, then :

    cordova run android --device

    1. I have opened Cordova project into Android Studio then I was able to see connected device, so it worked well
    0 讨论(0)
  • 2021-01-30 02:59

    Just use

    cordova run android --device
    
    0 讨论(0)
  • 2021-01-30 02:59

    On LG G4 (on Windows OS) you need to do the following:

    1. Install LG USB drivers from http://www.lg.com/uk/support/support-mobile/lg-LGH815
    2. Activate Developer mode (7 clicks stuff)
    3. Activate USB debugging for current workstation computer (in developer options)
    4. Connect device (adb drivers will be installed then)
    5. Run cordova run android --device
    0 讨论(0)
  • 2021-01-30 03:00

    I´ve an LG G4, and i´m using Visual Studio Tools for Apache Cordova (TACO).

    When trying to debug on device i was receiving the message: Unable to deploy to Android device, no attached device was found. If you recently attached a device, you may need to wait a few seconds before it is recognized.

    And what worked for me was changing the device from the media transfer protocol (MTP) to photo transfer protocol (PTP), in the USB settings. Phone Screenshot

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