native-run: native run android --list not showing device

Hi. So because of updating the ionic cli to 5.0.0 native-run is required. I have been trying to run the following command : $ ionic cordova run android --device

In short, it kept trying to open the Emulator rather than use my device, I checked native-run android --list, but the device was not appearing, however, it is appearing in adb devices.

I am able to get around running it with the --no-native-run flag, however, thought I’d post an issue as the device doesn’t seem to be appearing in the native-run list at all.

For reference, the phone I’m using is a Samsung A40.

$ native-run android --list
Connected Devices:

 No connected devices found

Virtual Devices:

 Pixel 2 API 28 (API 28) Pixel_2_API_28

$ adb devices
List of devices attached
R58M38D7HZR     device

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 16 (4 by maintainers)

Most upvoted comments

I’m facing the same issue (#22). You can run with the

--no-native-run

flag, like

ionic cordova run android --no-native-run

At least for me it worked, instead of downgrading.

Thanks! Looks like an issue with the parser and Windows EOL (\r\n). Fixing that. Is anyone getting this issue who’s not on Windows?

Okay, marking this as done! Please update native-run to 0.2.1 and devices should be listed.

For anyone not on Windows, please create a new issue! 👍

Thanks everyone!

Hey all, I have the same issue.

@dwieeb - Here is my output (I hope it helps):

  native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_SDK_ROOT +5ms
  native-run:android:utils:sdk:resolveSDKRoot Looking at following directories: [ 'C:\\Users\\<USER>\\AppData\\Local\\Android\\Sdk' ] +1ms
  native-run:android:utils:sdk:resolveSDKRoot Using C:\Users\<USER>\AppData\Local\Android\Sdk +5ms
  native-run:android:utils:sdk:resolveEmulatorHome Looking for $ANDROID_EMULATOR_HOME +0ms
  native-run:android:utils:sdk:resolveEmulatorHome Using $HOME/.android/ at C:\Users\<USER>\.android +1ms
  native-run:android:utils:sdk:resolveAVDHome Looking for $ANDROID_AVD_HOME +0ms
  native-run:android:utils:sdk:resolveAVDHome Using $HOME/.android/avd/ at C:\Users\<USER>\.android\avd +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\platform-tools\package.xml +0ms
  native-run:android:utils:avd:getAVDINIs Discovered AVD ini files: [ 'C:\\Users\\<USER>\\.android\\avd\\Nexus_5X_API_28.ini',
  native-run:android:utils:avd:getAVDINIs   'C:\\Users\\<USER>\\.android\\avd\\Pixel_2_API_28.ini' ] +0ms
  native-run:android:utils:adb:getDevices Invoking adb: 'C:\\Users\\<USER>\\AppData\\Local\\Android\\Sdk\\platform-tools/adb' [ 'devices', '-l' ] +0ms
  native-run:android:utils:sdk:findAllSDKPackages Walking C:\Users\<USER>\AppData\Local\Android\Sdk to discover SDK
packages +0ms
  native-run:android:utils:adb:parseAdbDevices adb devices output line does not match expected regex: 'MWS0216B24001482
    offline transport_id:3\r' +0ms
  native-run:android:utils:adb:parseAdbDevices adb devices output line does not match expected regex: '\r' +0ms
  native-run:android:utils:adb:getDevices Found adb devices: [] +60ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\docs\package.xml +0ms  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\emulator\package.xml
+0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\ndk-bundle\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\tools\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\build-tools\28.0.3\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\build-tools\29.0.0-rc3\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\cmake\3.10.2.4988404\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\cmake\3.6.4111459\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\patcher\v4\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\platforms\android-26\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\platforms\android-27\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\platforms\android-28\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\sources\android-26\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\sources\android-27\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\sources\android-28\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\<USER>\AppData\Local\Android\Sdk\system-images\android-28\google_apis_playstore\x86\package.xml +0ms
  native-run:android:utils:sdk:api:getAPILevels Discovered installed API Levels: [ { apiLevel: '28',
  native-run:android:utils:sdk:api:getAPILevels     packages:
  native-run:android:utils:sdk:api:getAPILevels      [ 'platforms;android-28',
  native-run:android:utils:sdk:api:getAPILevels        'system-images;android-28;google_apis_playstore;x86',
  native-run:android:utils:sdk:api:getAPILevels        'sources;android-28' ] },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '27',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-27', 'sources;android-27' ] },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '26',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-26', 'sources;android-26' ] } ] +0ms
  native-run:android:utils:avd:validateSkin Checking skin layout file: C:\Users\<USER>\AppData\Local\Android\Sdk\skins\pixel_2\layout +0ms
  native-run:android:utils:avd:validateSystemImagePath Checking package.xml file: C:\Users\<USER>\AppData\Local\Android\Sdk\system-images\android-28\google_apis_playstore\x86\package.xml +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Using schematic Pixel_2_API_28 for default AVD +0ms
Connected Devices:

  No connected devices found

Virtual Devices:

  Nexus 5X API 28 (API 28) Nexus_5X_API_28
  Pixel 2 API 28 (API 28) Pixel_2_API_28

I had the same problem in my ubuntu 18.04 solved by the following steps: vim ~/.profile insert below lines to the end of the file

export ANDROID_HOME=$HOME/Android/Sdk

export PATH=$PATH:$ANDROID_HOME/tools

export PATH=$PATH:$ANDROID_HOME/platform-tools

Now save the file and run another command:

source ~/.profile

Problem solved

@dwieeb Will do first thing tomorrow!

Hi, i have some problem, i’ve downgrade ionic-cli and everything is working again

$ npm i -g ionic@4.12.0