测试积点老人 发表于 2022-7-1 10:44:17

appium-desktop启动模拟器adb命令超时失败

1appium-desktop启动模拟器adb命令超时失败
2.使用appium-server启动没有问题报错如下: Welcome to Appium v1.15.0
Non-default server args:
   allowInsecure: {
   }
   denyInsecure: {
   }
Appium REST http interface listener started on 0.0.0.0:4723
--> POST /wd/hub/session
{"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}},"desiredCapabilities":{"platformName":"Android","platformVersion":"5.1.1","deviceName":"Android Emulator","appPackage":"com.android.calculator2","appActivity":".Calculator"}}
Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"5.1.1","deviceName":"Android Emulator","appPackage":"com.android.calculator2","appActivity":".Calculator"},null,{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}}]
Event 'newSessionRequested' logged at 1571708607532 (09:43:27 GMT+0800 (中国标准时间))
Could not parse W3C capabilities: 'deviceName' can't be blank
Trying to fix W3C capabilities by merging them with JSONWP caps
The capabilities ["platformVersion","deviceName","appPackage","appActivity"] are not standard capabilities and should have an extension prefix

======================================================================
   DEPRECATION WARNING:

   The 'automationName' capability was not provided in the desired
   capabilities for this Android session

   Setting 'automationName=UiAutomator2' by default and using the
   UiAutomator2 Driver

   The next major version of Appium (2.x) will **require** the
   'automationName' capability to be set for all sessions on all
   platforms

   In previous versions (Appium <= 1.13.x), the default was
   'automationName=UiAutomator1'

   If you wish to use that automation instead of UiAutomator2, please
   add 'automationName=UiAutomator1' to your desired capabilities

   For more information about drivers, please visit
   http://appium.io/docs/en/about-appium/intro/ and explore the
   'Drivers' menu

======================================================================

Appium v1.15.0 creating new AndroidUiautomator2Driver (v1.37.1) session
W3C capabilities and MJSONWP desired capabilities were provided
Creating session with W3C capabilities: {
   "alwaysMatch": {
   "platformName": "Android",
   "appium:platformVersion": "5.1.1",
   "appium:deviceName": "Android Emulator",
   "appium:appPackage": "com.android.calculator2",
   "appium:appActivity": ".Calculator"
   },
   "firstMatch": [
   {}
   ]
}
Session created with session id: 838e3971-499e-42b3-aacd-1ef1a14ff4be
Starting 'com.android.calculator2' directly on the device
Found 1 'build-tools' folders under 'E:\androidsdk\android-sdk-windows' (newest first):
   E:/androidsdk/android-sdk-windows/build-tools/29.0.2
Using 'adb.exe' from 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe'
Retrieving device list
Trying to find a connected android device
Getting connected devices...
Connected devices: [{"udid":"emulator-5554","state":"device"}]
Looking for a device with Android '5.1.1'
Setting device id to emulator-5554
Getting device platform version
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
Current device property 'ro.build.version.release': 5.1.1
Using device: emulator-5554
Using 'adb.exe' from 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe'
Setting device id to emulator-5554
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
Current device property 'ro.build.version.sdk': 22
Device API level: 22
No app sent in, not parsing package/activity
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device'
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'
Pushing settings apk to device...
Getting install status for io.appium.settings
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
'io.appium.settings' is installed
Getting package info for 'io.appium.settings'
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["E:\\androidsdk\\android-sdk-windows\\platform-tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\emulator\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\bin\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\build-tools\\29.0.2\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'E:\androidsdk\android-sdk-windows'?
Using 'aapt.exe' from 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\aapt.exe'
The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('2.14.2' >= '2.14.2')
There is no need to install/upgrade 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
Getting IDs of all 'io.appium.settings' processes
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pidof --help > /dev/null; echo $?''
Using ps-based PID detection
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ps'
io.appium.settings is already running. There is no need to reset its permissions.
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put secure mock_location 1'
Starting logcat capture
Getting install status for io.appium.uiautomator2.server
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
'io.appium.uiautomator2.server' is installed
Getting package info for 'io.appium.uiautomator2.server'
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["E:\\androidsdk\\android-sdk-windows\\platform-tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\emulator\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\tools\\bin\\apkanalyzer.bat","E:\\androidsdk\\android-sdk-windows\\build-tools\\29.0.2\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'E:\androidsdk\android-sdk-windows'?
The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.3.0' >= '4.3.0')
io.appium.uiautomator2.server installation state: sameVersionInstalled
Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk
Using 'apksigner.bat' from 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\apksigner.bat'
Starting 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v4.3.0.apk"]'
apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87

'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is already signed.
Getting install status for io.appium.uiautomator2.server.test
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
'io.appium.uiautomator2.server.test' is not installed
Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
Starting 'E:\androidsdk\android-sdk-windows\build-tools\29.0.2\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk"]'
apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87

'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already signed.
Server packages are going to be (re)installed
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
The current Android API does not support extended ls options. Defaulting to no-options call
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'ls /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
The count of applications in the cache: 2
The application at 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' is already cached to '/data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk'
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk'
Deleting UiAutomator2 session
Deleting UiAutomator2 server session
Matched '/' to command name 'deleteSession'
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
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.android.calculator2'
Stopping logcat capture
Removing forwarded port socket connection: 8200
Running 'E:\androidsdk\android-sdk-windows\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp\:8200'
Unable to remove port forward 'Error executing adbExec. Original error: 'Command 'E:\\androidsdk\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s emulator-5554 forward --remove tcp\:8200' exited with code 1'; Stderr: 'adb.exe: error: listener 'tcp:8200' not found'; Code: '1''
Event 'newSessionStarted' logged at 1571708636226 (09:43:56 GMT+0800 (中国标准时间))
Encountered internal error running command: Error executing adbExec. Original error: 'Command 'E:\\androidsdk\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'uiautomator2ServerInstallTimeout' capability
Error: Command 'E:\\androidsdk\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/0cc1725a60a05dbb5d0d09256f2fc6ece7e3b10f.apk' timed out after 20000ms
   at Timeout.setTimeout (C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\teen_process\lib\exec.js:125:19)
   at ontimeout (timers.js:427:11)
   at tryOnTimeout (timers.js:289:5)
   at listOnTimeout (timers.js:252:5)
   at Timer.processTimers (timers.js:212:10)
<-- POST /wd/hub/session 500 28715 ms - 1450


qqq911 发表于 2022-7-4 11:03:46

检查下环境配置把

海海豚 发表于 2022-7-4 11:12:56

重新看下配置的环境

kallinr 发表于 2022-7-4 11:45:40

没遇到过
页: [1]
查看完整版本: appium-desktop启动模拟器adb命令超时失败