Appium Inspector Cannot start the application

Dear all,

I have an issue when starting inspector an Android app from Appium Desktop.

Environment:

  • Appium: v1.18.0
  • Android Emulator: 5.1 - API 22

My Desired Capabilities:
{
“platformName”: “Android”,
“platformVersion”: “5.1”,
“deviceName”: “emulator-5554”,
“app”: “/Users/apple/Downloads/Test/myapp.apk”
}

Then I clicked on Start Session and Appium got stuck. It opened up the application successfully, but right after that it retried and restarted the application. After some retries, the session automatically ended.

Here is Appium error logs:
[MJSONWP] Encountered internal error running command: Error: Cannot start the ‘com.test.myapp’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘/Users/apple/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am start -W -n com.test.myapp/md545eea55db75a4d74.SplashActivity -S’ timed out after 20000ms’. Try to increase the 20000ms adb execution timeout represented by ‘adbExecTimeout’ capability
[MJSONWP] at ADB.startApp (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/apk-utils.js:177:11)

NOTE:
I tried copying and executing the following appium run command in terminal and it successfully run the application without any issue:
/Users/apple/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am start -W -n com.test.myapp/md545eea55db75a4d74.SplashActivity -S

Could you all please support me to resolve this issue?

Many thanks,