问题
Appium执行报这个错误
报错信息
Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: ‘DELETE /’ cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed)
日志信息:
The server is running
[HTTP] Waiting until the server is closed
[HTTP] Received server close event
[Appium] Welcome to Appium v1.22.3
[Appium] Non-default server args:
[Appium] relaxedSecurityEnabled: true
[Appium] allowInsecure: {
[Appium] }
[Appium] denyInsecure: {
[Appium] }
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] → POST /wd/hub/session
[HTTP] {“capabilities”:{“alwaysMatch”:{“platformName”:“Android”,“appium:platformVersion”:“12”,“appium:devicesName”:“ZY22DWKL9F”,“appium:appActivity”:“com.base.followcat/.MainActivity”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},“firstMatch”:[{}]},“desiredCapabilities”:{“platformName”:“Android”,“appium:platformVersion”:“12”,“appium:devicesName”:“ZY22DWKL9F”,“appium:appActivity”:“com.base.followcat/.MainActivity”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true}}
[W3C] Calling AppiumDriver.createSession() with args: [{“platformName”:“Android”,“appium:platformVersion”:“12”,“appium:devicesName”:“ZY22DWKL9F”,“appium:appActivity”:“com.base.followcat/.MainActivity”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},null,{“alwaysMatch”:{“platformName”:“Android”,“appium:platformVersion”:“12”,“appium:devicesName”:“ZY22DWKL9F”,“appium:appActivity”:“com.base.followcat/.MainActivity”,“appium:ensureWebviewsHavePages”:true,“appium:nativeWebScreenshot”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},“firstMatch”:[{}]}]
[BaseDriver] Event ‘newSessionRequested’ logged at 1679024686020 (11:44:46 GMT+0800 (中国标准时间))
[Appium]
[Appium] ======================================================================
[Appium] DEPRECATION WARNING:
[Appium]
[Appium] The ‘automationName’ capability was not provided in the desired
[Appium] capabilities for this Android session
[Appium]
[Appium] Setting ‘automationName=UiAutomator2’ by default and using the
[Appium] UiAutomator2 Driver
[Appium]
[Appium] The next major version of Appium (2.x) will require the
[Appium] ‘automationName’ capability to be set for all sessions on all
[Appium] platforms
[Appium]
[Appium] In previous versions (Appium <= 1.13.x), the default was
[Appium] ‘automationName=UiAutomator1’
[Appium]
[Appium] If you wish to use that automation instead of UiAutomator2, please
[Appium] add ‘automationName=UiAutomator1’ to your desired capabilities
[Appium]
[Appium] For more information about drivers, please visit
[Appium] Introduction - Appium and explore the
[Appium] ‘Drivers’ menu
[Appium]
[Appium] ======================================================================
[Appium]
[Appium] Appium v1.22.3 creating new AndroidUiautomator2Driver (v1.70.1) session
[Appium] Applying relaxed security to ‘AndroidUiautomator2Driver’ as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver] “alwaysMatch”: {
[BaseDriver] “platformName”: “Android”,
[BaseDriver] “appium:platformVersion”: “12”,
[BaseDriver] “appium:devicesName”: “ZY22DWKL9F”,
[BaseDriver] “appium:appActivity”: “com.base.followcat/.MainActivity”,
[BaseDriver] “appium:ensureWebviewsHavePages”: true,
[BaseDriver] “appium:nativeWebScreenshot”: true,
[BaseDriver] “appium:newCommandTimeout”: 3600,
[BaseDriver] “appium:connectHardwareKeyboard”: true
[BaseDriver] },
[BaseDriver] “firstMatch”: [
[BaseDriver] {}
[BaseDriver] ]
[BaseDriver] }
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver] devicesName
[BaseDriver] connectHardwareKeyboard
[BaseDriver] Session created with session id: c6fe92cc-a150-4e7f-bf99-512836749bf1
[UiAutomator2] Neither ‘app’ nor ‘appPackage’ was set. Starting UiAutomator2 without the target application
[ADB] Using ‘adb.exe’ from ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe’
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 start-server’
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices
[ADB] Connected devices: [{“udid”:“ZY22DWKL9F”,“state”:“device”}]
[AndroidDriver] Looking for a device with Android ‘12.0.0’
[ADB] Setting device id to ZY22DWKL9F
[ADB] Getting device platform version
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell getprop ro.build.version.release’
[ADB] Current device property ‘ro.build.version.release’: 12
[AndroidDriver] Using device: ZY22DWKL9F
[ADB] Using ‘adb.exe’ from ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe’
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 start-server’
[ADB] Setting device id to ZY22DWKL9F
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell getprop ro.build.version.sdk’
[ADB] Current device property ‘ro.build.version.sdk’: 31
[ADB] Getting device platform version
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell getprop ro.build.version.release’
[ADB] Current device property ‘ro.build.version.release’: 12
[ADB] Device API level: 31
[UiAutomator2] Relaxing hidden api policy
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F 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’’
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F wait-for-device’
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell echo ping’
[AndroidDriver] Pushing settings apk to device…
[ADB] Getting install status for io.appium.settings
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell dumpsys package io.appium.settings’
[ADB] ‘io.appium.settings’ is installed
[ADB] Getting package info for ‘io.appium.settings’
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell dumpsys package io.appium.settings’
[ADB] The version name of the installed ‘io.appium.settings’ is greater or equal to the application version name (‘3.4.0’ >= ‘3.4.0’)
[ADB] There is no need to install/upgrade ‘C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk’
[ADB] Getting IDs of all ‘io.appium.settings’ processes
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell ‘pgrep --help; echo $?’’
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell pgrep -f ([[:blank:]]|^)io.appium.settings([[:blank:]]|$)’
[AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell appops set io.appium.settings android:mock_location allow’
[Logcat] Starting logs capture with command: C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F logcat -v threadtime
[UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8200
[ADB] Forwarding system: 8200 to device: 6790
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F forward tcp:8200 tcp:6790’
[ADB] Getting install status for io.appium.uiautomator2.server
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell dumpsys package io.appium.uiautomator2.server’
[ADB] ‘io.appium.uiautomator2.server’ is installed
[ADB] Getting package info for ‘io.appium.uiautomator2.server’
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell dumpsys package io.appium.uiautomator2.server’
[ADB] The version name of the installed ‘io.appium.uiautomator2.server’ is greater or equal to the application version name (‘4.27.0’ >= ‘4.27.0’)
[UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[ADB] Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk
[ADB] Using the previously cached signature entry for ‘appium-uiautomator2-server-v4.27.0.apk’
[ADB] sha256 hash did match for ‘appium-uiautomator2-server-v4.27.0.apk’
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell dumpsys package io.appium.uiautomator2.server.test’
[ADB] ‘io.appium.uiautomator2.server.test’ is installed
[ADB] Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[ADB] Using the previously cached signature entry for ‘appium-uiautomator2-server-debug-androidTest.apk’
[ADB] sha256 hash did match for ‘appium-uiautomator2-server-debug-androidTest.apk’
[UiAutomator2] Server packages are not going to be (re)installed
[UiAutomator2] Waiting up to 30000ms for services to be available
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell pm list instrumentation’
[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
[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”,“;”]]
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;’
[UiAutomator2] No app capability. Assuming it is already on the device
[UiAutomator2] Performing shallow cleanup of automation leftovers
[UiAutomator2] No obsolete sessions have been detected (socket hang up)
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell am force-stop io.appium.uiautomator2.server.test’
[UiAutomator2] Starting UIAutomator2 server 4.27.0
[UiAutomator2] Using UIAutomator2 server from ‘C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk’ and test from ‘C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\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…
[ADB] Creating ADB subprocess with args: [“-P”,5037,“-s”,“ZY22DWKL9F”,“shell”,“am”,“instrument”,“-w”,“-e”,“disableAnalytics”,true,“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[Instrumentation] INSTRUMENTATION_RESULT: shortMsg=Process crashed.
[Instrumentation] INSTRUMENTATION_CODE: 0
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[Instrumentation] The process has exited with code 0
[UiAutomator2] The instrumentation process has been unexpectedly terminated. Retrying UiAutomator2 startup (#1 of 1)
[UiAutomator2] Performing strict cleanup of automation leftovers
[UiAutomator2] No obsolete sessions have been detected (socket hang up)
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell am force-stop io.appium.uiautomator2.server.test’
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting IDs of all ‘uiautomator’ processes
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell pgrep -f ([[:blank:]]|^)uiautomator([[:blank:]]|$)’
[ADB] No ‘uiautomator’ process has been found
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online…
[ADB] Creating ADB subprocess with args: [“-P”,5037,“-s”,“ZY22DWKL9F”,“shell”,“am”,“instrument”,“-w”,“-e”,“disableAnalytics”,true,“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[Instrumentation] INSTRUMENTATION_RESULT: shortMsg=Process crashed.
[Instrumentation] INSTRUMENTATION_CODE: 0
[WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[Instrumentation] The process has exited with code 0
[UiAutomator2] The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: ‘DELETE /’ 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
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8200
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F forward --remove tcp:8200’
[UiAutomator2] Restoring hidden api policy to the device default configuration
[ADB] Running ‘C:\Users\Administrator\AppData\Local\Android\android-sdk\platform-tools\adb.exe -P 5037 -s ZY22DWKL9F shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’
[BaseDriver] Event ‘newSessionStarted’ logged at 1679024700570 (11:45:00 GMT+0800 (中国标准时间))
[W3C] Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
[W3C] at Object.errorAndThrow (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:94:35)
[W3C] at UiAutomator2Server.startSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\uiautomator2.js:247:13)
[W3C] at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:416:5)
[W3C] at AndroidUiautomator2Driver.createSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:229:7)
[W3C] at AppiumDriver.createSession (C:\Users\Administrator\AppData\Local\Programs\Appium Server GUI\resources\app\node_modules\appium\lib\appium.js:387:35)
[HTTP] ← POST /wd/hub/session 500 14552 ms - 927
[HTTP]
求大神解决,删除服务重新下载什么的都试过了,还是不行