cordova-android: cordova run android gives "Failed to execute shell command cat,/proc/cpuinfo" error

Issue Type

  • Bug Report
  • Feature Request
  • Support Question

Description

I’m having problem running an ionic project using “(ionic) cordova run android” and “(ionic) cordova emulate android”. I get the same error with both:

Failed to execute shell command “cat,/proc/cpuinfo”" on device: Error: D:\Android\Sdk\platform-tools\adb.exe: Command failed with exit code 3221226356

Any help is appreciated.

Information

Command or Code

cordova run android

Environment, Platform, Device

Version information

I’ve tried the latest versions of both cordova (9) and ionic (5) cli. I also tried downgrading and I am currently using: ionic: 4.12.0 cordova: 8.1.2 node: v10.16.0 (LTS)

Using VS Code. I use the Android SDK from Android Studio.

Checklist

  • I searched for already existing GitHub issues about this
  • I updated all Cordova tooling to their most recent version
  • I included all the necessary information above

About this issue

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

Most upvoted comments

I think it’s worth mentioning, for future visitors, that Google has updated the platform-tools and fixed the bug in adb. It works fine on version 29.0.1.

@breautek and @sirdas : Finally I managed to make it work by following the procedure of @breautek (thank you)[https://stackoverflow.com/a/56474669/4685664], by copying that the file adb.exe, by copying the other two it does not work, @sirdas is what can you test and keep me informed? Thank you

I’ve updated my android tooling to the latest and still failing to reproduce the issue unfortunately. I am on Linux however, not a windows platform. Not sure if that would be significant.

Ideas of mine is reaching thin.

There is an answer on StackOverflow regarding the error code on your exact ADB version on windows, and solution was to downgrade.

The answer instructed to use a link, but you should be able to just use the SDK Manager to view older versions of platform tools by unchecking Hide Obsolete Packages checkbox.

Thank you @breautek. Downgrading Android SDK platform-tools works! I should note that it’s not possible to downgrade the version of platform-tools via Android Studio or the sdkmanager cli (only the most recent version is available). I uninstalled platform-tools and then I used a link to download platform-tools v28 (http://dl.google.com/android/repository/platform-tools_r28.0.0-windows.zip) and copy platform-tools over to the Sdk folder. You can pretty much just edit the version number in the URL to get whatever version you want from Google’s repo. Cheers