HomeAppium

Error: Command failed: *adb.exe -s emulator-5554 shell “ps ‘uiautomator'””

Like Tweet Pin it Share Share Email

Especially when working with Appium (1.4.16), Android Studio (2.2.3 and above) and with Android N (7.0) version, execution of test automation script encounters the below error:

Error: Command failed: C:\Windows\system32\cmd.exe /s /c “C:\Users\{user}\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell “ps ‘uiautomator'””

Error you see in Appium server:

Error in Android studio run console:

Solution for this error is to append and replace the code in adb.js file present at location

C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib

Code changes to be done goes as below:

  1. Go to adb.js in the path ‘node_modules//appium/node_modules/appium-adb/lib/adb.js’
    ***Find the below**

    Append the below
  2. Find the ‘ADB.prototype.getPIDsByName ‘ and replace the whole section

Performing above changes you are good to go ahead, for more detail you can refer to the actual discussion at appium support website

Comments (12)

Leave a Reply

Your email address will not be published. Required fields are marked *