Search code examples
androidcordovaadbionic-framework

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?


Solution

  • 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.