35

I have 2 devices detected in adb. One from my genymotion, and the other from my real device :

$ adb devices
List of devices attached
192.168.57.101:5555 device
e78ab88d    device

I want to run my ionic app on e78ab88d device. How can i achieve this? If i run ionic run android, its automatically run on my genymotion device. It says, no target specified. img no target specified

What command to run on specific device?

dehamzah
  • 1,373
  • 1
  • 11
  • 19

4 Answers4

87

run with target device id, something like :

ionic run android --target=e78ab88d

EDIT

With new Ionic 3 CLI use :

ionic cordova run android --target=e78ab88d

For list of all available devices, use :

ionic cordova run android --list
Randyka Yudhistira
  • 3,612
  • 1
  • 26
  • 41
  • 1
    what is that deviceID? can it be changed to a simple human readable form? – Shri Apr 01 '16 at 08:43
  • if you run `adb devices`, you see all devices. If you're the only one, that's the only entry – Martijn Dec 13 '16 at 13:06
  • If you are working with just cordova you can use the same command without the `ionic` keyworkd: `cordova run android --target=e78ab88d` as in my case, it worked for me. – Alberto Apr 01 '19 at 07:54
11

try this command may help you

ionic run android --e78ab88d
Mi-Creativity
  • 9,554
  • 10
  • 38
  • 47
ionMobDev
  • 351
  • 1
  • 4
  • 20
0

Using --target=e78ab88d failed for me. But it seemed to work when I used --device=e78ab88d.

Basically I have 2 Android phones connected and I wanted to target a specific device. without the --target or --device, it deployed randomly to the devices.

ionic cordova run android --device=e78ab88d worked for me. Just in case someone is experiencing the same problem as me.

RealSollyM
  • 1,530
  • 1
  • 22
  • 35
0

to also run the app live do. $ionic cordova run android -l

make sure that the phone is connected with laptop through cable.