Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
133 views
in Technique[技术] by (71.8m points)

android - Running phonegap on device - no device found

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...
[phonegap] using the local environment
[phonegap] compiling Android...
[phonegap] successfully compiled Android app
[phonegap] trying to install app onto device
[phonegap] no device was found

-> adb devices
List of devices attached 
SH25PW103163    device

I just ran a native Android app in eclipse on this device, I have USB Debugging activated.

What can be wrong?

question from:https://stackoverflow.com/questions/19767810/running-phonegap-on-device-no-device-found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...