The Connected Device:
It is running Developer Options with USB debugging enabled
It is using MTP as the Device file manager
Drivers have been installed to the laptop with no issues and I can browse the files fine
When I run: ionic cordova run android --device
I get this output:
BUILD SUCCESSFUL in 5s
42 actionable tasks: 42 up-to-date
Built the following apk(s):
C:\Users\K-PC\myApp\platforms\android\app\build\outputs\apk\debug\app-debug.apk
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-debug.apk --device
[native-run] ERR_NO_DEVICE: No hardware devices found. Not attempting emulator because --device was specified.
[native-run]
[native-run] More details for this error may be available online:
[native-run]
[native-run] https://github.com/ionic-team/native-run/wiki/Android-Errors
[ERROR] An error occurred while running subprocess native-run.
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
I checked to see if the device was listed using native-run android --list
and I get this output:
Errors (!):
ERR_UNSUITABLE_API_INSTALLATION: No suitable API installation found.
More details for this error may be available online:
https://github.com/ionic-team/native-run/wiki/Android-Errors
Connected Devices:
No connected devices found
Virtual Devices:
No virtual devices found
I have Android Studio installed, I have two virtual devices in my AVD manager:
I want to deploy the APK onto the device connected to my laptop, not these emulators but its strange to see that it hasn't even recognised the emulators inside my AVD manager
How can I fix this issue? I hope I have given enough detail.
Using ADB
adb devices
That command should give you a list of the attached devices. You must accept the debug mode on the phone. Before trying to run the app with a hardware device you should check that adb has a connection with one device atleast.Some issues may appear like:
In summary you should run this code:
adb devices
, Authorize to connect with the computer. Solve the issues(if there's any) already commented above.ionic cordova run android --device
.