appium / appium-uiautomator2-driver

Appium driver for Android UIAutomator2
Apache License 2.0
552 stars 172 forks source link

try to increase the 20000ms adb execution timeout represented by 'adbexectimeout' capability #444

Closed anniegandhi closed 3 years ago

anniegandhi commented 3 years ago

Whenever I run my basic code to install the apk and run it , apk gets installed but it fails with adb execution timeout.

=> I have tried to increase the adb execution timeout manually also using : capabilities.setCapability("adbExecTimeout", 90000);But it didn't work.

Starting 'com.zscaler.insights/host.exp.exponent.MainActivity and waiting for 'com.zscaler.insights/host.exp.exponent.MainActivity' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.zscaler.insights/host.exp.exponent.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [debug] [UiAutomator2] Deleting UiAutomator2 session [debug] [UiAutomator2] Deleting UiAutomator2 server session [debug] [WD Proxy] Matched '/' to command name 'deleteSession' [debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8200/wd/hub/session/a0be481d-6300-4290-948d-7cbf6cd28f81] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"a0be481d-6300-4290-948d-7cbf6cd28f81","value":null} [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.zscaler.insights' [debug] [Logcat] Stopping logcat capture [debug] [ADB] Removing forwarded port socket connection: 8200 [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8200' [debug] [BaseDriver] Event 'newSessionStarted' logged at 1610274278806 (02:24:38 GMT-0800 (Pacific Standard Time)) [debug] [W3C] Encountered internal error running command: Error: Cannot start the 'com.zscaler.insights' 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 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.zscaler.insights/host.exp.exponent.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' timed out after 90000ms'. Try to increase the 20000ms adb execution timeout represented by 'adbExecTimeout' capability [debug] [W3C] at ADB.startApp (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:177:11) [debug] [W3C] at AndroidUiautomator2Driver.ensureAppStarts (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:554:7) [debug] [W3C] at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:422:7) [debug] [W3C] at AndroidUiautomator2Driver.createSession (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:224:7) [debug] [W3C] at AppiumDriver.createSession (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\lib\appium.js:371:35) ..........................................................................................................................................................................................

When I try to run the command on my terminal : C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5556 shell am start -W -n com.zscaler.insights/host.exp.exponent.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 ......

It works perrfectly fine , and app doesn't get exit .

Kindly help resolving my issue , Where is the problem ?

Some key points:

  1. The apk runs fine on normal android device.
  2. The issue is only happening with my appium code , when I try to open the app using that.

My code: AndroidDriver driver;

    // TODO Auto-generated method stub
 File appDir = new File("src");
 File app = new File(appDir, "Exec.apk");
 DesiredCapabilities capabilities = new DesiredCapabilities();
 //capabilities.setCapability("uiautomator2ServerInstallTimeout" , "true");
 //capabilities.setCapability("appWaitforLaunch", "false");
 capabilities.setCapability("adbExecTimeout", 50000);
 //capabilities.setCapability("appWaitDuration",30000);
 capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "test_executive_insights");
 capabilities.setCapability("automationName", "UiAutomator2");
 capabilities.setCapability("noReset", "true");
 capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
 driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    return driver;
}
mykola-mokhnach commented 3 years ago

Try setting appium:appWaitForLaunch to false

anniegandhi commented 3 years ago

Hi ,

Thanks for replying to my issue query. But sadly, I already tried to do the same . It didn't work.

Please suggest something else.

Attached recording for the same.

On Sun, Feb 21, 2021 at 9:13 PM Mykola Mokhnach notifications@github.com wrote:

Try setting appium:appWaitForLaunch https://github.com/appium/appium-uiautomator2-driver#app to false

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/appium/appium-uiautomator2-driver/issues/444#issuecomment-782878029, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS5YLEK6HPDUBPS55EKYKI3TAES35ANCNFSM4X6ZJ4NA .

mykola-mokhnach commented 3 years ago

I cannot help without the full server log

anniegandhi commented 3 years ago

C:\Users\Zscaler>appium [Appium] Welcome to Appium v1.20.0 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [debug] [HTTP] Request idempotency key: a8eb23a6-0973-4f45-a48f-1e75991bb342 [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitforLaunch":"false","noReset":"true","adbExecTimeout":50000,"automationName":"UiAutomator2","platformName":"Android","deviceName":"test_executive_insights"},"capabilities":{"firstMatch":[{"appium:adbExecTimeout":50000,"appium:app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitforLaunch":"false","appium:automationName":"UiAutomator2","appium:deviceName":"test_executive_insights","appium:noReset":"true","platformName":"android"}]}} [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitforLaunch":"false","noReset":"true","adbExecTimeout":50000,"automationName":"UiAutomator2","platformName":"Android","deviceName":"test_executive_insights"},null,{"firstMatch":[{"appium:adbExecTimeout":50000,"appium:app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitforLaunch":"false","appium:automationName":"UiAutomator2","appium:deviceName":"test_executive_insights","appium:noReset":"true","platformName":"android"}]}] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1613979292760 (23:34:52 GMT-0800 (Pacific Standard Time)) [BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix: [BaseDriver] appWaitforLaunch [Appium] Appium v1.20.0 creating new AndroidUiautomator2Driver (v1.60.0) session [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "appium:appWaitforLaunch": "false", [debug] [BaseDriver] "platformName": "android", [debug] [BaseDriver] "appium:adbExecTimeout": 50000, [debug] [BaseDriver] "appium:app": "C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk", [debug] [BaseDriver] "appium:automationName": "UiAutomator2", [debug] [BaseDriver] "appium:deviceName": "test_executive_insights", [debug] [BaseDriver] "appium:noReset": "true" [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] appWaitforLaunch [BaseDriver] Session created with session id: 764b8f62-4f16-4c5b-96b2-66d1b785416c [BaseDriver] Using local app 'C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk' [debug] [UiAutomator2] Checking whether app is actually present [ADB] Found 1 'build-tools' folders under 'C:\Users\Zscaler\AppData\Local\Android\Sdk' (newest first): [ADB] C:/Users/Zscaler/AppData/Local/Android/Sdk/build-tools/30.0.3 [ADB] Using 'adb.exe' from 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices [debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}] [AndroidDriver] Using device: emulator-5554 [ADB] Using 'adb.exe' from 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [debug] [ADB] Setting device id to emulator-5554 [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk' [debug] [ADB] Current device property 'ro.build.version.sdk': 27 [debug] [ADB] Device API level: 27 [debug] [AndroidDriver] Parsing package and activity from app manifest [ADB] Package name: 'com.zscaler.insights' [ADB] Main activity name: 'host.exp.exponent.MainActivity' [debug] [AndroidDriver] Parsed package and activity are: com.zscaler.insights/host.exp.exponent.MainActivity [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping' [debug] [AndroidDriver] Pushing settings apk to device... [debug] [ADB] Getting install status for io.appium.settings [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [debug] [ADB] 'io.appium.settings' is installed [debug] [ADB] Getting package info for 'io.appium.settings' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.2.1' >= '3.2.1') [debug] [ADB] There is no need to install/upgrade 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [debug] [ADB] Getting IDs of all 'io.appium.settings' processes [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?'' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|\^)io.appium.settings([[:blank:]]|\$)' [debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions. [debug] [Logcat] Starting logs capture with command: C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 logcat -v threadtime [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8200 [debug] [ADB] Forwarding system: 8200 to device: 6790 [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790' [debug] [ADB] Getting install status for io.appium.uiautomator2.server [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [debug] [ADB] 'io.appium.uiautomator2.server' is installed [debug] [ADB] Getting package info for 'io.appium.uiautomator2.server' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [debug] [ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.17.2' >= '4.17.2') [debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled [debug] [ADB] Checking app cert for C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk [ADB] Using 'apksigner.jar' from 'C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar' [debug] [ADB] Starting apksigner: 'C:\Program Files (x86)\Java\jdk1.8.0_271\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar verify --print-certs C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk [debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [debug] [ADB] [debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.17.2.apk' [ADB] 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk' is signed with the default certificate [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test' [debug] [ADB] 'io.appium.uiautomator2.server.test' is installed [debug] [ADB] Checking app cert for C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk [debug] [ADB] Starting apksigner: 'C:\Program Files (x86)\Java\jdk1.8.0_271\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar verify --print-certs C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk [debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [debug] [ADB] [debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk' [ADB] 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is signed with the default certificate [UiAutomator2] Server packages are not going to be (re)installed [debug] [UiAutomator2] Waiting up to 30000ms for services to be available [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation' [Logcat] Logcat terminated with code 1, signal null [debug] [UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available [ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist [debug] [ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server.test",";"]] [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;' [debug] [ADB] Checking app cert for C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk [debug] [ADB] Starting apksigner: 'C:\Program Files (x86)\Java\jdk1.8.0_271\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar verify --print-certs C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk [debug] [ADB] apksigner stdout: Signer #1 certificate DN: CN=com.zscaler.insights, OU=, O=, L=, ST=, C=US [debug] [ADB] Signer #1 certificate SHA-256 digest: 11c29a70132defb4b722871710b755bb3f1c64d28a41e438ae6c9f88cd9af189 [debug] [ADB] Signer #1 certificate SHA-1 digest: 6a8eacddc06ab54a90b72f008a8cc23d2f676fc8 [debug] [ADB] Signer #1 certificate MD5 digest: c8b4dcde29891b6dd445d2bdf4de4c2f [debug] [ADB] [ADB] 'C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk' is signed with a non-default certificate [debug] [ADB] Getting install status for com.zscaler.insights [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.zscaler.insights' [debug] [ADB] 'com.zscaler.insights' is installed [debug] [ADB] Getting package info for 'com.zscaler.insights' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.zscaler.insights' [debug] [ADB] The version name of the installed 'com.zscaler.insights' is greater or equal to the application version name ('1.0.9' >= '1.0.9') [debug] [ADB] There is no need to install/upgrade 'C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk' [debug] [UiAutomator2] Performing shallow cleanup of automation leftovers [debug] [UiAutomator2] No obsolete sessions have been detected (socket hang up) [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test' [UiAutomator2] Starting UIAutomator2 server 4.17.2 [UiAutomator2] Using UIAutomator2 server from 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk' and test from 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' [UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online... [debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"] [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server: [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [WD Proxy] socket hang up [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}} [debug] [UiAutomator2] The initialization of the instrumentation process took 8753ms [debug] [WD Proxy] Matched '/session' to command name 'createSession' [debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8200/wd/hub/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","appWaitforLaunch":"false","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","automationName":"UiAutomator2","deviceName":"test_executive_insights","noReset":true},"platformName":"android","appWaitforLaunch":"false","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","automationName":"UiAutomator2","deviceName":"emulator-5554","noReset":true,"deviceUDID":"emulator-5554","appPackage":"com.zscaler.insights"}],"alwaysMatch":{}}} [debug] [WD Proxy] Got response with status 200: {"sessionId":"c90568cc-945f-40a7-8ea5-a7c4fc4230f2","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","appWaitforLaunch":"false","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","automationName":"UiAutomator2","deviceName":"test_executive_insights","noReset":true},"platformName":"android","appWaitforLaunch":"false","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","automationName":"UiAutomator2","deviceName":"emulator-5554","noReset":true,"deviceUDID":"emulator-5554","appPackage":"com.zscaler.insights"}],"alwaysMatch":{}},"sessionId":"c90568cc-945f-40a7-8ea5-a7c4fc4230f2"}} [WD Proxy] Determined the downstream protocol as 'W3C' [debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8200/wd/hub/session/c90568cc-945f-40a7-8ea5-a7c4fc4230f2/appium/device/info] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"c90568cc-945f-40a7-8ea5-a7c4fc4230f2","value":{"androidId":"d9b21c2a181eb223","apiVersion":"27","bluetooth":null,"brand":"google","carrierName":"Android","displayDensity":440,"locale":"en_US","manufacturer":"Google","model":"Android SDK built for x86","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":102400,"linkUpstreamBandwidthKbps":51200,"networkCapabilities":"NET_CAPABILITY_MMS,NET_CAPABILITY_SUPL,NET_CAPABILITY_DUN,NET_CAPABILITY_FOTA,NET_CAPABILITY_IMS,NET_CAPABILITY_CBS,NET_CAPABILITY_IA,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED","signalStrength":-2147483648,"transportTypes":"TRANSPORT_CELLULAR"},"detailedState":"CONNECTED","extraInfo":"epc.tmobile.com","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":13,"subtypeName":"LTE","type":0,"typeName":"MOBILE"},{"capabilities":{"SSID":null,"linkDownBandwidthKbps":1048576,"linkUpstreamBandwidt... [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window' [AndroidDriver] Screen already unlocked, doing nothing [UiAutomator2] Starting 'com.zscaler.insights/host.exp.exponent.MainActivity and waiting for 'com.zscaler.insights/host.exp.exponent.MainActivity' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.zscaler.insights/host.exp.exponent.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [debug] [UiAutomator2] Deleting UiAutomator2 session [debug] [UiAutomator2] Deleting UiAutomator2 server session [debug] [WD Proxy] Matched '/' to command name 'deleteSession' [debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8200/wd/hub/session/c90568cc-945f-40a7-8ea5-a7c4fc4230f2] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"c90568cc-945f-40a7-8ea5-a7c4fc4230f2","value":null} [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.zscaler.insights' [debug] [Instrumentation] . [debug] [Logcat] Stopping logcat capture [debug] [Logcat] Logcat already stopped [debug] [ADB] Removing forwarded port socket connection: 8200 [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8200' [debug] [BaseDriver] Event 'newSessionStarted' logged at 1613979486087 (23:38:06 GMT-0800 (Pacific Standard Time)) [debug] [W3C] Encountered internal error running command: Error: Cannot start the 'com.zscaler.insights' 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 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.zscaler.insights/host.exp.exponent.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' timed out after 50000ms'. Try to increase the 50000ms adb execution timeout represented by 'adbExecTimeout' capability [debug] [W3C] at ADB.startApp (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:177:11) [debug] [W3C] at AndroidUiautomator2Driver.ensureAppStarts (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:554:7) [debug] [W3C] at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:422:7) [debug] [W3C] at AndroidUiautomator2Driver.createSession (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:224:7) [debug] [W3C] at AppiumDriver.createSession (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\lib\appium.js:371:35) [HTTP] <-- POST /wd/hub/session 500 193546 ms - 1847 [HTTP] [debug] [Instrumentation] Time: 54.545 [debug] [Instrumentation] [debug] [Instrumentation] OK (1 test) [debug] [Instrumentation] The process has exited with code 0

anniegandhi commented 3 years ago

Hi , I have added the complete server log .. Let me know if you still require any information from my side.

mykola-mokhnach commented 3 years ago

[BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] appWaitforLaunch

The capability name was not spelled properly

anniegandhi commented 3 years ago

Hi ,

Thankyou so much . It worked for me :)

Appreciate your help.

Regards, Aashima

On Mon, Feb 22, 2021 at 2:25 PM Mykola Mokhnach notifications@github.com wrote:

[BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] appWaitforLaunch

The capability name was not spelled properly

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/appium/appium-uiautomator2-driver/issues/444#issuecomment-783209224, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS5YLEK5KC3NGU7P2RLG4R3TAILXRANCNFSM4X6ZJ4NA .

anniegandhi commented 3 years ago

Hi ,

I got stuck in the below error.I am not able to find the root cause for it.

This issue came randomly . Could you please help what is causing this?

appium [Appium] Welcome to Appium v1.20.0 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [debug] [HTTP] Request idempotency key: daed3dbb-2a1d-4ec6-80e6-94516c565c1b [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","noReset":"true","appium:appWaitForLaunch":"false","adbExecTimeout":50000,"automationName":"UiAutomator2","platformName":"Android","deviceName":"test_executive_insights"},"capabilities":{"firstMatch":[{"appium:adbExecTimeout":50000,"appium:app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appium:appWaitForLaunch":"false","appium:automationName":"UiAutomator2","appium:deviceName":"test_executive_insights","appium:noReset":"true","platformName":"android"}]}} [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","noReset":"true","appium:appWaitForLaunch":"false","adbExecTimeout":50000,"automationName":"UiAutomator2","platformName":"Android","deviceName":"test_executive_insights"},null,{"firstMatch":[{"appium:adbExecTimeout":50000,"appium:app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appium:appWaitForLaunch":"false","appium:automationName":"UiAutomator2","appium:deviceName":"test_executive_insights","appium:noReset":"true","platformName":"android"}]}] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1618295598972 (23:33:18 GMT-0700 (Pacific Daylight Time)) [Appium] Appium v1.20.0 creating new AndroidUiautomator2Driver (v1.60.0) session [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "platformName": "android", [debug] [BaseDriver] "appium:adbExecTimeout": 50000, [debug] [BaseDriver] "appium:app": "C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk", [debug] [BaseDriver] "appium:appWaitForLaunch": "false", [debug] [BaseDriver] "appium:automationName": "UiAutomator2", [debug] [BaseDriver] "appium:deviceName": "test_executive_insights", [debug] [BaseDriver] "appium:noReset": "true" [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior [BaseDriver] Capability 'appWaitForLaunch' changed from string to boolean. This may cause unexpected behavior [BaseDriver] Session created with session id: 328927ce-bff6-452e-87b0-17f613c7db67 [BaseDriver] Using local app 'C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk' [debug] [UiAutomator2] Checking whether app is actually present [ADB] Found 1 'build-tools' folders under 'C:\Users\Zscaler\AppData\Local\Android\Sdk' (newest first): [ADB] C:/Users/Zscaler/AppData/Local/Android/Sdk/build-tools/30.0.3 [ADB] Using 'adb.exe' from 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices [debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}] [AndroidDriver] Using device: emulator-5554 [ADB] Using 'adb.exe' from 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server' [debug] [ADB] Setting device id to emulator-5554 [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk' [debug] [ADB] Current device property 'ro.build.version.sdk': 27 [debug] [ADB] Device API level: 27 [debug] [AndroidDriver] Parsing package and activity from app manifest [ADB] Package name: 'com.zscaler.insights' [ADB] Main activity name: 'host.exp.exponent.MainActivity' [debug] [AndroidDriver] Parsed package and activity are: com.zscaler.insights/host.exp.exponent.MainActivity [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping' [debug] [AndroidDriver] Pushing settings apk to device... [debug] [ADB] Getting install status for io.appium.settings [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [debug] [ADB] 'io.appium.settings' is installed [debug] [ADB] Getting package info for 'io.appium.settings' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings' [debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.2.1' >= '3.2.1') [debug] [ADB] There is no need to install/upgrade 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [debug] [ADB] Getting IDs of all 'io.appium.settings' processes [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?'' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|\^)io.appium.settings([[:blank:]]|\$)' [debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions. [debug] [Logcat] Starting logs capture with command: C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 logcat -v threadtime [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8200 [debug] [ADB] Forwarding system: 8200 to device: 6790 [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790' [debug] [ADB] Getting install status for io.appium.uiautomator2.server [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [debug] [ADB] 'io.appium.uiautomator2.server' is installed [debug] [ADB] Getting package info for 'io.appium.uiautomator2.server' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server' [debug] [ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.17.2' >= '4.17.2') [debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled [debug] [ADB] Checking app cert for C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk [ADB] Using 'apksigner.jar' from 'C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar' [debug] [ADB] Starting apksigner: 'C:\Program Files (x86)\Java\jdk1.8.0_271\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar verify --print-certs C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk [debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS= @., CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [debug] [ADB] [debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.17.2.apk' [ADB] 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk' is signed with the default certificate [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test' [debug] [ADB] 'io.appium.uiautomator2.server.test' is installed [debug] [ADB] Checking app cert for C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk [debug] [ADB] Starting apksigner: 'C:\Program Files (x86)\Java\jdk1.8.0_271\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar verify --print-certs C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk [debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS= @., CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [debug] [ADB] [debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk' [ADB] 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is signed with the default certificate [UiAutomator2] Server packages are not going to be (re)installed [debug] [UiAutomator2] Waiting up to 30000ms for services to be available [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation' [debug] [UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available [ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist [debug] [ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server.test",";"]] [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;' [debug] [ADB] Checking app cert for C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk [debug] [ADB] Starting apksigner: 'C:\Program Files (x86)\Java\jdk1.8.0_271\bin\java.exe' -Xmx1024M -Xss1m -jar C:\Users\Zscaler\AppData\Local\Android\Sdk\build-tools\30.0.3\lib\apksigner.jar verify --print-certs C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk [debug] [ADB] apksigner stdout: Signer #1 certificate DN: CN=com.zscaler.insights, OU=, O=, L=, ST=, C=US [debug] [ADB] Signer #1 certificate SHA-256 digest: 11c29a70132defb4b722871710b755bb3f1c64d28a41e438ae6c9f88cd9af189 [debug] [ADB] Signer #1 certificate SHA-1 digest: 6a8eacddc06ab54a90b72f008a8cc23d2f676fc8 [debug] [ADB] Signer #1 certificate MD5 digest: c8b4dcde29891b6dd445d2bdf4de4c2f [debug] [ADB] [ADB] 'C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk' is signed with a non-default certificate [debug] [ADB] Getting install status for com.zscaler.insights [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.zscaler.insights' [debug] [ADB] 'com.zscaler.insights' is installed [debug] [ADB] Getting package info for 'com.zscaler.insights' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.zscaler.insights' [debug] [ADB] The version name of the installed 'com.zscaler.insights' is greater or equal to the application version name ('1.0.9' >= '1.0.9') [debug] [ADB] There is no need to install/upgrade 'C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk' [debug] [UiAutomator2] Performing shallow cleanup of automation leftovers [debug] [UiAutomator2] No obsolete sessions have been detected (timeout of 500ms exceeded) [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test' [UiAutomator2] Starting UIAutomator2 server 4.17.2 [UiAutomator2] Using UIAutomator2 server from 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.17.2.apk' and test from 'C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' [UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online... [debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"] [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}} [debug] [UiAutomator2] The initialization of the instrumentation process took 70ms [debug] [WD Proxy] Matched '/session' to command name 'createSession' [debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8200/wd/hub/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitForLaunch":false,"automationName":"UiAutomator2","deviceName":"test_executive_insights","noReset":true},"platformName":"android","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitForLaunch":false,"automationName":"UiAutomator2","deviceName":"emulator-5554","noReset":true,"deviceUDID":"emulator-5554","appPackage":"com.zscaler.insights"}],"alwaysMatch":{}}} [debug] [WD Proxy] Got response with status 200: {"sessionId":"a89feb49-8acc-42fb-829e-c89d2aa00ab9","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitForLaunch":false,"automationName":"UiAutomator2","deviceName":"test_executive_insights","noReset":true},"platformName":"android","adbExecTimeout":50000,"app":"C:\Users\Zscaler\eclipse-workspace\Zscaler\src\Exec.apk","appWaitForLaunch":false,"automationName":"UiAutomator2","deviceName":"emulator-5554","noReset":true,"deviceUDID":"emulator-5554","appPackage":"com.zscaler.insights"}],"alwaysMatch":{}},"sessionId":"a89feb49-8acc-42fb-829e-c89d2aa00ab9"}} [WD Proxy] Determined the downstream protocol as 'W3C' [debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8200/wd/hub/session/a89feb49-8acc-42fb-829e-c89d2aa00ab9/appium/device/info] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"a89feb49-8acc-42fb-829e-c89d2aa00ab9","value":{"androidId":"d9b21c2a181eb223","apiVersion":"27","bluetooth":null,"brand":"google","carrierName":"Android","displayDensity":440,"locale":"en_US","manufacturer":"Google","model":"Android SDK built for x86","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":102400,"linkUpstreamBandwidthKbps":51200,"networkCapabilities":"NET_CAPABILITY_MMS,NET_CAPABILITY_SUPL,NET_CAPABILITY_DUN,NET_CAPABILITY_FOTA,NET_CAPABILITY_IMS,NET_CAPABILITY_CBS,NET_CAPABILITY_IA,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED","signalStrength":-2147483648,"transportTypes":"TRANSPORT_CELLULAR"},"detailedState":"CONNECTED","extraInfo":" epc.tmobile.com ","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":13,"subtypeName":"LTE","type":0,"typeName":"MOBILE"},{"capabilities":{"SSID":null,"linkDownBandwidthKbps":1048576,"linkUpstreamBandwidt... [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window' [AndroidDriver] Screen already unlocked, doing nothing [UiAutomator2] Starting 'com.zscaler.insights/host.exp.exponent.MainActivity and waiting for 'com.zscaler.insights/host.exp.exponent.MainActivity' [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -n com.zscaler.insights/host.exp.exponent.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [debug] [ADB] Waiting up to 20000ms for activity matching pkg: 'com.zscaler.insights' and activity: 'host.exp.exponent.MainActivity' to be focused [debug] [ADB] Possible activities, to be checked: 'host.exp.exponent.MainActivity', 'com.zscaler.insights.host.exp.exponent.MainActivity' [debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window windows' [debug] [ADB] Found package: 'com.google.android.apps.nexuslauncher' and fully qualified activity name : 'com.google.android.apps.nexuslauncher.NexusLauncherActivity' [debug] [ADB] Incorrect package and activity. Retrying. [debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window windows' [debug] [ADB] Found package: 'com.zscaler.insights' and fully qualified activity name : 'host.exp.exponent.MainActivity' [debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8200/wd/hub/session/a89feb49-8acc-42fb-829e-c89d2aa00ab9/appium/device/pixel_ratio] with no body [WD Proxy] socket hang up [debug] [UiAutomator2] Deleting UiAutomator2 session [debug] [UiAutomator2] Deleting UiAutomator2 server session [debug] [WD Proxy] Matched '/' to command name 'deleteSession' [debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8200/wd/hub/session/a89feb49-8acc-42fb-829e-c89d2aa00ab9] with no body [WD Proxy] socket hang up [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.zscaler.insights' [debug] [Logcat] Stopping logcat capture [debug] [ADB] Removing forwarded port socket connection: 8200 [debug] [ADB] Running 'C:\Users\Zscaler\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8200' [debug] [BaseDriver] Event 'newSessionStarted' logged at 1618295610808 (23:33:30 GMT-0700 (Pacific Daylight Time)) [debug] [W3C] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up [debug] [W3C] at UIA2Proxy.command (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:275:13) [debug] [W3C] at runMicrotasks () [debug] [W3C] at processTicksAndRejections (internal/process/task_queues.js:93:5) [debug] [W3C] at AndroidUiautomator2Driver.commands.getDevicePixelRatio (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\commands\viewport.js:14:10) [debug] [W3C] at AndroidUiautomator2Driver.fillDeviceDetails (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:239:28) [debug] [W3C] at AndroidUiautomator2Driver.createSession (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:225:7) [debug] [W3C] at AppiumDriver.createSession (C:\Users\Zscaler\AppData\Roaming\npm\node_modules\appium\lib\appium.js:371:35) [HTTP] <-- POST /wd/hub/session 500 12055 ms - 1359 [HTTP] [debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:

Regards, Aashima

On Mon, Feb 22, 2021 at 2:37 PM Aashima Gandhi @.***> wrote:

Hi ,

Thankyou so much . It worked for me :)

Appreciate your help.

Regards, Aashima

On Mon, Feb 22, 2021 at 2:25 PM Mykola Mokhnach @.***> wrote:

[BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] appWaitforLaunch

The capability name was not spelled properly

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/appium/appium-uiautomator2-driver/issues/444#issuecomment-783209224, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS5YLEK5KC3NGU7P2RLG4R3TAILXRANCNFSM4X6ZJ4NA .

Nadeem-rmd commented 1 year ago

I'm stuck with the same error. Any resolution to this?

RanjitSolanke32 commented 1 year ago

I am also facing the same issue, also all spellings & appium codes are correct as earlier. Please any one suggestion will help me?

berekmerilorand commented 1 year ago

I'm facing this issue on both Android emulators and Genymotion (Cloud Gmsaas).

2 Android emulator logs errors examples:

[0-32] 2023-08-28T11:24:20.341Z ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details [0-32] 2023-08-28T11:24:20.356Z ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: 'GET /screenshot' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details [0-32] 2023-08-28T11:24:20.356Z ERROR @wdio/utils:shim: UnknownError: An unknown server-side error occurred while processing the command. Original error: 'GET /screenshot' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details [0-32] at UIA2Proxy.command (/home/circleci/.nvm/versions/node/v16.14.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:355:13) [0-32] at runMicrotasks (<anonymous>) [0-32] at processTicksAndRejections (node:internal/process/task_queues:96:5) [0-32] at AndroidUiautomator2Driver.commands.getScreenshot (/home/circleci/.appium/node_modules/appium-uiautomator2-driver/lib/commands/screenshot.js:18:10) [0-32] Error in "AfterTest Hook" An unknown server-side error occurred while processing the command. Original error: 'GET /screenshot' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details [0-32] 2023-08-28T11:24:20.435Z ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: Error attempting to start URI. Original error: Error: Error executing adbExec. Original error: 'Command '/home/circleci/android-sdk/platform-tools/adb -P 5037 -s localhost\:5554 shell am start -W -a android.intent.action.VIEW -d app-olxpk\:///motors com.olx.pk' exited with code 1'; Command output: adb: device 'localhost:5554' not found [0-32]

[0-35] RUNNING in android - /home/circleci/project/e2e/shared/specs/deep_link/logged_out/verifySearchFilterDeepLinks.AppClosed.test.ts [0-35] 2023-08-28T11:34:45.158Z ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device in 20041ms. [0-35] 2023-08-28T11:34:45.159Z ERROR webdriver: UnknownError: An unknown server-side error occurred while processing the command. Original error: **Could not find a connected Android device** in 20041ms. [0-35] at getResponseForW3CError (/home/circleci/.nvm/versions/node/v16.14.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1073:9) [0-35] at asyncHandler (/home/circleci/.nvm/versions/node/v16.14.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:491:57) [0-35] 2023-08-28T11:34:45.160Z ERROR @wdio/runner: Error: Failed to create session.

2 Genymotion errors examples:

[0-0] RUNNING in android - /home/circleci/project/e2e/shared/visual_specs/basic/***.test.ts [0-0] 2023-08-25T00:20:15.626Z ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability [0-0] 2023-08-25T00:20:15.627Z ERROR webdriver: UnknownError: An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. **You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability** [0-0] at getResponseForW3CError (/home/circleci/.nvm/versions/node/v16.14.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1073:9) [0-0] at asyncHandler (/home/circleci/.nvm/versions/node/v16.14.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:491:57) [0-0] 2023-08-25T00:20:15.628Z ERROR @wdio/runner: Error: Failed to create session. [0-0] An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability [0-0] at Object.startWebDriverSession (/home/circleci/project/node_modules/webdriver/build/utils.js:71:15) [0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5) [0-0] at async Function.newSession (/home/circleci/project/node_modules/webdriver/build/index.js:58:45) [0-0] at async Object.remote (/home/circleci/project/node_modules/@wdio/runner/node_modules/webdriverio/build/index.js:67:22) [0-0] at async Runner._startSession (/home/circleci/project/node_modules/@wdio/runner/build/index.js:217:56) [0-0] at async Runner._initSession (/home/circleci/project/node_modules/@wdio/runner/build/index.js:173:25) [0-0] at async Runner.run (/home/circleci/project/node_modules/@wdio/runner/build/index.js:87:19)

[0-0] RUNNING in android - /home/circleci/project/e2e/shared/visual_specs/basic/verifySelectLocationScreens.test.ts [0-0] 2023-08-25T00:20:15.626Z ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability [0-0] 2023-08-25T00:20:15.627Z ERROR webdriver: UnknownError: An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized within 30000ms timeout. Make sure the application under test does not crash and investigate the logcat output. You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability [0-0] at getResponseForW3CError (/home/circleci/.nvm/versions/node/v16.14.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:1073:9) [0-0] at asyncHandler (/home/circleci/.nvm/versions/node/v16.14.0/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:491:57) [0-0] 2023-08-25T00:20:15.628Z ERROR @wdio/runner: Error: Failed to create session.

One says to increase the uiautomator2ServerLaunchTimeout and the other for adbExecTimeout...

Please find my list of capabilities below:

exclude: ['../e2e/shared/specs/**/**/*.ios.test.ts'], 'appium:maxInstances': '1', 'appium:systemPort': '9082', 'appium:mjpegServerPort': '6796', platformName: 'android', 'appium:deviceName': DEVICE_FULL_NAME || 'Android emulator', 'appium:automationName': 'UiAutomator2', 'appium:udid': DEVICE_UUID || DEVICE_UUID_1 || 'emulator-5555', 'appium:platformVersion': OS_VERSION || '10', 'appium:app': path.resolve(APP_PATH || 'invalid path'), 'appium:appActivity': 'com.empg.olxeg.MainActivity', 'appium:appPackage': 'com.package', 'appium:newCommandTimeout': '120',

I;m debugging for now with appium:adbExecTimeout & appium:appWaitForLaunch and come back with an answer if it works.

Note

Another interesting issue that I saw is the one from below. The test passes but there're times when this error is displayed, and it's totally random, not occurring on same specs. For this issue I've added appium:newCommandTimeout and the error is still shown, but not that often.

[0-39] PASSED in android - /home/circleci/project/e2e/shared/visual_specs/ads/***.test.ts [0-40] RUNNING in android - /home/circleci/project/e2e/shared/visual_specs/ads/***.test.ts [0-40] 2023-08-28T01:49:24.141Z ERROR webdriver: Request failed with status 404 due to invalid session id: A session is either terminated or not started [0-40] 2023-08-28T01:49:24.575Z ERROR webdriver: Request failed with status 404 due to invalid session id: A session is either terminated or not started