Hello, I’m trying to run ionic capacitor run but it doesn’t find any device. Nor the emulator or physical android phone.
Running it from android studio works.
ionic capacitor run android --list
[INFO] No native targets found.
adb devices
List of devices attached
R9MN3010VFJ device
emulator-5554 device
avdmanager list 17:21:20
Available Android Virtual Devices:
Name: Pixel_3a_API_30_x86
Device: pixel_3a (Google)
Path: /home/baj/.android/avd/Pixel_3a_API_30_x86.avd
Target: Google APIs (Google Inc.)
Based on: Android 11.0 (R) Tag/ABI: google_apis/x86
Skin: pixel_3a
Sdcard: 800 MB
Available devices definitions:
id: 0 or "tv_1080p"
Name: Android TV (1080p)
OEM : Google
Tag : android-tv
Might be missing something on my system ? (Linux)
Thanks
I’m having the same problem. I can see my emulator with adb devices, but can’t with ionic capacitor run android --list or npx native-run android --list.
this was a bug in native-run, has been fixed in latest version (1.4.0)
since native-run is a dependency of @capacitor/cli, you can try to reinstall the CLI and it should pick the latest version, but make sure that was the case by checking the installed version in package-lock.json
If not updated, you can force update the dependency with npm update native-run --depth 6
@jcesarmobile Was this issue solved? I encountered the same exact issue. I have capacitor/android - 3.1.1
ionic 6.16.3, using visual studio on a Mac. I am able to use ionic cap open android, but not ionic cap run android.
I have both emulator and plugged in android showing on adb devices, but nothing comes up still on the terminal selection.
Also tried npm update native-run --depth 6 and it is version 1.4
native-run wasn’t compatible with SDK 30, that’s what was fixed in version 1.4.0, also capacitor wasn’t showing native-run errors and that was fixed in 3.0.2.
So if you can’t run and are using those versions or newer you are hitting a different problem.
Try running npx cap run command directly instead of the ionic one and it should show the error, or ever use npx native-run command directly.
Then, if you share the errors maybe I can help you, and they usually link the native-run wiki with the common problems and how to fix them.
That means the Android SDK was not found.
Did you install it?
If you did, did you create a ANDROID_SDK_ROOT environment variable pointing to the SDK folder?
Same issue
i am unable to find my connected device. adb devices show my physical connected device
but when i run npx cap run android
It only shows me emulators not my device.
when i run npx native-run android --list
Connected Devices:
No connected devices found
Virtual Devices:
Name API Target ID
----------------------------------------------
Pixel 3 API 30 API 30 Pixel_3_API_30
Pixel 4 XL API 30 API 30 Pixel_4_XL_API_30
Hi please be sure that the developer option and usb debugging on your device is enabled,
Once enable, on the Connected Devices: there will be a list of unauthorized device, which is you need to allow it