Command adb.exe' -P 5037 -s emulator-5554 install -r --no-incremental appium-uiautomator2-server-v5.12.2.apk'' timed out after 20000ms

Microsoft Windows [Version 10.0.19045.3324]
© Microsoft Corporation. All rights reserved.

C:\Users\Pc Planet>appium -p 4723
[Appium] Welcome to Appium v2.0.1
[Appium] Attempting to load driver uiautomator2…
[debug] [Appium] Requiring driver at C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLS in your client code to connect to this server:
[Appium] http://192.168.100.227:4723/
[Appium] http://127.0.0.1:4723/ (only accessible from the same host)
[Appium] Available drivers:
[Appium] - [email protected] (automationName ‘UiAutomator2’)
[Appium] No plugins have been installed. Use the “appium plugin” command to install the one(s) you want to use.
[HTTP] --> GET /sessions
[HTTP] {}
[debug] [AppiumDriver@190e] Calling AppiumDriver.getSessions() with args: []
[debug] [AppiumDriver@190e] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /sessions 304 77 ms - -
[HTTP]
[HTTP] --> POST /session
[HTTP] {“capabilities”:{“alwaysMatch”:{“appium:app”:“C:\Users\Pc Planet\eclipse-workspace\xPalApp\src\test\java\resources\app-debug.apk”,“platformName”:“android”,“appium:automationName”:“UiAutomator2”,“appium:udid”:“emulator-5554”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},“firstMatch”:[{}]},“desiredCapabilities”:{“appium:app”:“C:\Users\Pc Planet\eclipse-workspace\xPalApp\src\test\java\resources\app-debug.apk”,“platformName”:“android”,“appium:automationName”:“UiAutomator2”,“appium:udid”:“emulator-5554”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true}}
[debug] [AppiumDriver@190e] Calling AppiumDriver.createSession() with args: [{“appium:app”:“C:\Users\Pc Planet\eclipse-workspace\xPalApp\src\test\java\resources\app-debug.apk”,“platformName”:“android”,“appium:automationName”:“UiAutomator2”,“appium:udid”:“emulator-5554”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},null,{“alwaysMatch”:{“appium:app”:“C:\Users\Pc Planet\eclipse-workspace\xPalApp\src\test\java\resources\app-debug.apk”,“platformName”:“android”,“appium:automationName”:“UiAutomator2”,“appium:udid”:“emulator-5554”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},“firstMatch”:[{}]}]
[debug] [AppiumDriver@190e] Event ‘newSessionRequested’ logged at 1692090061838 (14:01:01 GMT+0500 (Pakistan Standard Time))
[Appium] Attempting to find matching driver for automationName ‘UiAutomator2’ and platformName ‘android’
[Appium] The ‘uiautomator2’ driver was installed and matched caps.
[Appium] Will require it at C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver
[debug] [Appium] Requiring driver at C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver
[AppiumDriver@190e] Appium v2.0.1 creating new AndroidUiautomator2Driver (v2.29.3) session
[AppiumDriver@190e] Checking BaseDriver versions for Appium and AndroidUiautomator2Driver
[AppiumDriver@190e] Appium’s BaseDriver version is 9.3.16
[AppiumDriver@190e] AndroidUiautomator2Driver’s BaseDriver version is 9.3.16
[debug] [AndroidUiautomator2Driver@8aa7] Creating session with W3C capabilities: {
[debug] [AndroidUiautomator2Driver@8aa7] “alwaysMatch”: {
[debug] [AndroidUiautomator2Driver@8aa7] “platformName”: “android”,
[debug] [AndroidUiautomator2Driver@8aa7] “appium:app”: “C:\Users\Pc Planet\eclipse-workspace\xPalApp\src\test\java\resources\app-debug.apk”,
[debug] [AndroidUiautomator2Driver@8aa7] “appium:automationName”: “UiAutomator2”,
[debug] [AndroidUiautomator2Driver@8aa7] “appium:udid”: “emulator-5554”,
[debug] [AndroidUiautomator2Driver@8aa7] “appium:ensureWebviewsHavePages”: true,
[debug] [AndroidUiautomator2Driver@8aa7] “appium:nativeWebScreenshot”: true,
[debug] [AndroidUiautomator2Driver@8aa7] “appium:newCommandTimeout”: 3600,
[debug] [AndroidUiautomator2Driver@8aa7] “appium:connectHardwareKeyboard”: true
[debug] [AndroidUiautomator2Driver@8aa7] },
[debug] [AndroidUiautomator2Driver@8aa7] “firstMatch”: [
[debug] [AndroidUiautomator2Driver@8aa7] {}
[debug] [AndroidUiautomator2Driver@8aa7] ]
[debug] [AndroidUiautomator2Driver@8aa7] }
[AndroidUiautomator2Driver@8aa7] The following capabilities were provided, but are not recognized by Appium:
[AndroidUiautomator2Driver@8aa7] connectHardwareKeyboard
[AndroidUiautomator2Driver@8aa7 (6e702e06)] Session created with session id: 6e702e06-7a19-4adf-b093-e8750b4cca86
[BaseDriver] Using local app ‘C:\Users\Pc Planet\eclipse-workspace\xPalApp\src\test\java\resources\app-debug.apk’
[debug] [AndroidUiautomator2Driver@8aa7 (6e702e06)] Checking whether app is actually present
[ADB] Found 2 ‘build-tools’ folders under ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk’ (newest first):
[ADB] C:/Users/Pc Planet/AppData/Local/Android/Sdk/build-tools/34.0.0
[ADB] C:/Users/Pc Planet/AppData/Local/Android/Sdk/build-tools/33.0.1
[ADB] Using ‘adb.exe’ from ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe’
[debug] [ADB] Running ‘C:\Users\Pc Planet\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”:“06081330BT105920”,“state”:“unauthorized”},{“udid”:“emulator-5554”,“state”:“device”}]
[AndroidDriver] Using device: emulator-5554
[ADB] Using ‘adb.exe’ from ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe’
[debug] [ADB] Running ‘C:\Users\Pc Planet\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\Pc Planet\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’: 31
[ADB] Getting device platform version
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release’
[debug] [ADB] Current device property ‘ro.build.version.release’: 12
[debug] [ADB] Device API level: 31
[AndroidUiautomator2Driver@8aa7 (6e702e06)] Relaxing hidden api policy
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ‘settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1’’
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: ‘com.mess.engerx’
[ADB] Main activity name: ‘com.mess.engerx.MainActivity’
[debug] [AndroidDriver] Parsed package and activity are: com.mess.engerx/com.mess.engerx.MainActivity
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device’
[debug] [ADB] Running ‘C:\Users\Pc Planet\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 package info for ‘io.appium.settings’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings’
[debug] [ADB] App ‘C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk’ is not installed
[debug] [ADB] Installing ‘C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 help’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 features’
[ADB] The application at ‘C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g ‘C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk’’
[ADB] The installation of ‘settings_apk-debug.apk’ took 1320ms
[debug] [ADB] Install command stdout: Performing Streamed Install
[debug] [ADB] Success
[debug] [ADB] Getting IDs of all ‘io.appium.settings’ processes
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ‘pgrep --help; echo $?’’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell appops set io.appium.settings PROJECT_MEDIA allow’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cmd notification allow_listener io.appium.settings/.NLService’
[debug] [ADB] Getting IDs of all ‘io.appium.settings’ processes
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[debug] [ADB] Starting Appium Settings app
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER’
[debug] [ADB] Getting IDs of all ‘io.appium.settings’ processes
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[debug] [ADB] Getting IDs of all ‘io.appium.settings’ processes
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[debug] [Logcat] Starting logs capture with command: ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe’ -P 5037 -s emulator-5554 logcat -v threadtime
[debug] [AndroidUiautomator2Driver@8aa7 (6e702e06)] Forwarding UiAutomator2 Server port 6790 to local port 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790’
[debug] [ADB] Checking app cert for C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk
[debug] [ADB] Checking app cert for C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[ADB] Using ‘apksigner.jar’ from ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\build-tools\34.0.0\lib\apksigner.jar’
[debug] [ADB] Starting apksigner: ‘C:\Program Files\Java\jdk-20\bin\java.exe’ -Xmx1024M -Xss1m -jar ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\build-tools\34.0.0\lib\apksigner.jar’ verify --print-certs ‘C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’
[debug] [ADB] Starting apksigner: ‘C:\Program Files\Java\jdk-20\bin\java.exe’ -Xmx1024M -Xss1m -jar ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\build-tools\34.0.0\lib\apksigner.jar’ verify --print-certs ‘C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk’
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: [email protected], 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\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’ is signed with the default certificate
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm path io.appium.uiautomator2.server.test’
[debug] [ADB] ‘io.appium.uiautomator2.server.test’ is not installed
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: [email protected], 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-v5.12.2.apk’
[ADB] ‘C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk’ is signed with the default certificate
[debug] [ADB] Getting package info for ‘io.appium.uiautomator2.server’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server’
[debug] [ADB] App ‘C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk’ is not installed
[debug] [AndroidUiautomator2Driver@8aa7 (6e702e06)] Server packages status: [{“wasSigned”:true,“installState”:“notInstalled”,“appPath”:“C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk”,“appId”:“io.appium.uiautomator2.server”},{“wasSigned”:true,“installState”:“notInstalled”,“appPath”:“C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk”,“appId”:“io.appium.uiautomator2.server.test”}]
[AndroidUiautomator2Driver@8aa7 (6e702e06)] Server packages are going to be (re)installed
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 version’
[ADB] The application at ‘C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental ‘C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk’’
[ADB] The application at ‘C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’ will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental ‘C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’’
[ADB] The installation of ‘appium-uiautomator2-server-debug-androidTest.apk’ took 11987ms
[debug] [ADB] Install command stdout: Performing Streamed Install
[debug] [ADB] Success
[debug] [AndroidUiautomator2Driver@8aa7 (6e702e06)] Deleting UiAutomator2 session
[debug] [AndroidUiautomator2Driver@8aa7 (6e702e06)] Deleting UiAutomator2 server session
[debug] [AndroidUiautomator2Driver@8aa7 (6e702e06)] Matched ‘/’ to command name ‘deleteSession’
[AndroidUiautomator2Driver@8aa7 (6e702e06)] 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
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys activity services io.appium.settings/.recorder.RecorderService’
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.mess.engerx’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8200’
[AndroidUiautomator2Driver@8aa7 (6e702e06)] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running ‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’
[debug] [AppiumDriver@190e] Event ‘newSessionStarted’ logged at 1692090135076 (14:02:15 GMT+0500 (Pakistan Standard Time))
[debug] [AppiumDriver@190e] Encountered internal error running command: Error executing adbExec. Original error: ‘Command ‘‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe’ -P 5037 -s emulator-5554 install -r --no-incremental ‘C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk’’ timed out after 20000ms’. Try to increase the 20000ms adb execution timeout represented by ‘uiautomator2ServerInstallTimeout’ capability
[debug] [AppiumDriver@190e] Error: Command ‘‘C:\Users\Pc Planet\AppData\Local\Android\Sdk\platform-tools\adb.exe’ -P 5037 -s emulator-5554 install -r --no-incremental ‘C:\Users\Pc Planet\.appium\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.12.2.apk’’ timed out after 20000ms
[debug] [AppiumDriver@190e] at Timeout._onTimeout (C:\Users\Pc Planet.appium\node_modules\appium-uiautomator2-driver\node_modules\teen_process\lib\exec.js:140:19)
[debug] [AppiumDriver@190e] at listOnTimeout (node:internal/timers:569:17)
[debug] [AppiumDriver@190e] at processTimers (node:internal/timers:512:7)
[HTTP] <-- POST /session 500 73372 ms - 1604
[HTTP]

Manually Installing the server.apk and test.apk solved the problem. But would like to know why didnt the command above install them

It could be that the host machine is too slow. Try to get a more powerful machine or increase the server install timeout as suggested in the error message

@mykola-mokhnach you are right. The machine was extremely slow