I've recently started working with capacitor using using ionic 5. I've read all the capacitor documentation but I didn't find any guidance that how can I run Ionic 5 app on real android device. Can anyone guide me how can run Ionic 5 app on real android device? Thanks.
Asked
Active
Viewed 8,075 times
3 Answers
2
You can run ionic 5 on real android device with command:
$ ionic capacitor run android --target [device-id]
To get real android device-id, you can run this command:
$ adb devices
Example:
$ adb device
List of devices attached
05fca57a7d29 device
$ ionic capacitor run android --target 05fca57a7d29
> ng run app:build
✔ Browser application bundle generation complete.
✔ Copying assets complete.
✔ Index html generation complete.
...

iruwl
- 131
- 1
- 5
1
Edit:
Since Capacitor 3 there is a run command
npx cap run android
It will show you a list of available devices/emulators to choose where you want to run.
Old answer:
Capacitor apps are run from Android Studio directly
If you already have an Ionic project with Capacitor integrated, just run npx cap open
to open Android Studio, and with a device plugged, do Run -> Run 'app'
or click the green triangle button.

jcesarmobile
- 51,328
- 11
- 132
- 176
1
You can execute the following command to run the app directly into the device.
What it will do is it will detect the connected device and ask you to select which device you want to run.
ionic capacitor run android --device

Manthan
- 17
- 7