3
votes

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.

2

2 Answers

2
votes

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.

0
votes

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