"ionic run android" starts the emulator, and don't deploy it to the device


#1

When I execute “ionic run android” or “cordova run android”, the emulator opens. This is happening on ubuntu 14.04. I don’t really know why its happening, and it’s giving me a headache…

Can anyone help me please?
Thanks!


#2

That’s probably because adb doesn’t see your phone. Use this command to list the connected devices :

adb devices -l

If your phone is not listed, that’s the problem.

If you were able to run the app on your phone before, just try to disable/enable USB debug mode on your phone or restart it. This fixes it for me, most of the time.
If not, make sure you have the correct drivers and that your phone has USB debug enabled.


#3

Make that : adb devices -l

> adb devices -l
List of devices attached
0149A4481400D005       device usb:FA140000 product:mysid model:Galaxy_Nexus device:toro

#4

The console shows this:

List of devices attached
??? no permissions usb:2-1.2

What’s wrong? :open_mouth:


#5

Well, after a 4 hour internet surfing, I find the answer. I follow all this steps:

http://ttde.uniandes.edu.co/ttdewikim1/index.php/Android_Instalación_(Linux)

And after that, I do this:

  1. Execute this command on terminal " adb kill-server"
  2. Now connect device to system wait, 10-20 seconds.
  1. Execute this command on terminal " adb start-server", Check device status with "adb

devices " command.

This detect my device, and then with “ionic run android” it deploy it. This will solve this issue to anyone that is using Ubuntu as OS.

Thanks everyone!! @Calendee @maximel


Ionic 2: ionic run android
Ionic 2: ionic run android
#6

for anyone landing here and just wondering where to type the “adb devices” command … like it did… has to be done :

When plugged in over USB, you can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you’ll see the device name listed as a “device.”

which is something typically like : C:\Users\username\AppData\Local\Android\sdk\platform-tools

source


#7

hi masudjuan … links that you’ve attached not working. can you give me another links? because I had same problems here, in my terminal it says “no permissions usb:3-2” … thanks … regards


#8

Just for clarity, If the the path to SDK platform-tools/ is in the system path , it not necessary to cd to the platform-tools directory.


#9

This is really odd - I had this working fine and I haven’t change a single thing with my android setup.

Not a thing.

I have, however, been using Ionic View instead for a long time. I want to test on device again now because some of the plugins don’t work on Ionic View.

I’m also getting the

-bash: adb: command not found

error.

Why has this changed?


#10

@SubEffect More likely you need to add the sdk to the system path, that is why adb: command not found gets thrown, so make sure you add it.

The OP was for not deploying on the connected device - from my personal experiments, I think that could be for one of the following reasons:

  • The connected android device is using an old android os version < 4.1
  • The cable used to connect the device is of a low quality and fails data transfer

So always run the following command as stated above to list all connected devices:

adb devices -l

Hope this helps,


#11

Not really.

The SDK has been added to the system path or or wouldn’t have worked previously.

And I have been trying that adb command - that’s how I got that error.