ERROR : Make sure the application under test does not crash and investigate the logcat output

I get error

WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output

  • Appium version: 1.15.1
  • Windown 10
  • Mobile platform/version under test: Pixel XL
  • Real device or emulator/simulator: Simmulator
  • How Appium Installed : using npm

[Instrumentation] INSTRUMENTATION_STATUS: id=ActivityManagerService

[Instrumentation] INSTRUMENTATION_STATUS_CODE: -1

[Instrumentation] The process has exited with code 1

[UiAutomator2] Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.

[UiAutomator2] at Object.wrappedLogger.errorAndThrow (C:\Users\chanchai\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:79:13)

[UiAutomator2] at UiAutomator2Server.errorAndThrow [as startSession] (C:\Users\chanchai\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:227:13)

[UiAutomator2] Deleting UiAutomator2 session

[UiAutomator2] Deleting UiAutomator2 server session

[WD Proxy] Matched ā€˜/ā€™ to command name ā€˜deleteSessionā€™

[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id

[ADB] Running ā€˜C:\Users\chanchai\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.kongqw.serialportā€™

[Logcat] Stopping logcat capture

[ADB] Removing forwarded port socket connection: 8200

[ADB] Running ā€˜C:\Users\chanchai\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8200ā€™

[UiAutomator2] Restoring hidden api policy to the device default configuration

[ADB] Running ā€˜C:\Users\chanchai\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_appsā€™

[ADB] Running ā€˜C:\Users\chanchai\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_p_appsā€™

[ADB] Running ā€˜C:\Users\chanchai\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policyā€™

[BaseDriver] Event ā€˜newSessionStartedā€™ logged at 1583400169729 (16:22:49 GMT+0700 (SE Asia Standard Time))

[MJSONWP] Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.

[MJSONWP] at Object.wrappedLogger.errorAndThrow (C:\Users\chanchai\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:79:13)

[MJSONWP] at UiAutomator2Server.errorAndThrow [as startSession] (C:\Users\chanchai\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:227:13)

[HTTP] <-- POST /wd/hub/session 500 13242 ms - 274

[HTTP]

[HTTP] --> DELETE /wd/hub/session

[HTTP] {}

[HTTP] No route found. Setting content type to ā€˜text/plainā€™

[HTTP] <-- DELETE /wd/hub/session 404 3 ms - 57

[HTTP]

Hello Team,

I got the same issue for the my project.

Please someone help me.

I Got similar type of error when automating iOS app, my app was crashing frequently. Issue was occurring because app was build using latest XCode and was running fine with simulator having latest iOS. while i was using some obsolete Xcode/simulaor/iOS combinations.
May be similar sort of reason is causing app crash in your case also.(Though your app is an android app.)

Has anyone got the solution for this, if so please help. Even i am using appium 1.15.1 and stuck with same issue.

im have solotion i dowload new java jdk and set new java_home

Did this solution help you @priyanka_ram
As iam getting same issue

Please set the following capability : ā€œautomationNameā€: ā€œUiAutomator1ā€

@vineeta_shambu

this worked for me

4 Likes

Thanks @Shilpa0503,
This solved it for me too. How did you know this was going to work?

Hello,

appium-doctor inform me that I was missing some android depencies, in particular sdk toolsā€¦
I solved this problem by installing the android SDK tools 26.1.1
Now all is working with UIautomator2

Good Luck

It is not the good solution, UIautomator1 is deprecatedā€¦
You have to check your sdk tools you have to miss some tools.

1 Like

Thank you so much. This worked for me too.

Hi Shambu,

Thanks for the help, It worked for me. Great Help!!

Yes, this temporary solution works for me.

to @all
check U global variables, there must be PATH

C:\Users\User\AppData\Local\Android\Sdk\tools

Iā€™ve set this capability, ran a test case then deleted it. After that it started working correctly using UiAutomator2. This fixed the issue for me, thanks

If your appium verison is what is stated above, just download and install the latest version, it will solve the issues.

It worked immediately I upgraded my version

desired_caps[ā€˜automationNameā€™] = ā€˜UiAutomator1ā€™
succeed
Thank you. I wasted an hour