简体   繁体   中英

Problems connecting Android device and running adb commands

I'm developing an Ionic-framework app, and I have troubles running the command ionic run android which runs the apk directly on a connected Android device, it just does nothing, like in this question: Ionic run android seems to work, but the app is not launched on the phone, why?

So I tried to install the apk with adb install and it does nothing too.

The only way to install an apk is to save it directly into the device and install it with packet manager.

Other adb commands like adb usb just run and never finnish, doing nothing. The only commands that seems to work is adb logcat and adb devices which show no problem with my device:

$ adb devices -l
List of devices attached 
0123456789ABCDEF       device usb:2-1.5

I'm using:

Ionic    --version 1.3.20
Cordova  --version 5.0.0 
Phonegap --version 4.2.0-0.24.2
Android device: HTC One S
Android version: 4.1.1 HTC Sense 4+
SO: Ubuntu 14.10 64 bits

I have all Android SDKs installed.

What is the problem?

How did you give adb install ? adb install path to apk(Drag and drop apk to command prompt) and the press enter to start install

This issue may come from your device AND from your USB dongle.

If you are using Samsung, you need to install http://www.samsung.com/us/kies/ and update your device drivers.

I faced that issue with Galaxy S3 & Galaxy S4 and after update with keys and change of USB calbe, it was working as expected.

I had to replace the HTC device and its USB cable with a Samsung device and a generic cable. Searching the Internet I found that for some reason adb doesn't work well or at all with HTC.

Plus, I had to constantly kill the adb process with adb kill-server , so it could start fresh with every adb command.

Ionic run android also uses adb, and it worked fine with the Samsung device as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM