Appium appium 脚本中加上 desired_caps ['automationName']='uiautomator2'就会报错 socket hang up

lei · 2019年05月29日 · 最后由 飞天萝卜 回复于 2021年06月29日 · 1816 次阅读

在脚本中加上 desired_caps['automationName']='uiautomator2'就会报错,注释掉运行正常
appium 输出日志如下:
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error
was: UnknownError: An unknown server-side error occurred while processing the c
ommand. Original error: Could not proxy command to remote server. Original error
: Error: socket hang up
[debug] [UiAutomator2] Resetting IME to 'io.appium.settings/.UnicodeIME'
[debug] [ADB] Running 'D:\Android\android-sdk\platform-tools\adb.exe -P 5037 -s
VBJ4C18517001054 shell ime set io.appium.settings/.UnicodeIME'
[debug] [ADB] Running 'D:\Android\android-sdk\platform-tools\adb.exe -P 5037 -s
VBJ4C18517001054 shell am force-stop com.clickcoo.yishuobaobao'
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running 'D:\Android\android-sdk\platform-tools\adb.exe -P 5037 -s
VBJ4C18517001054 forward --remove tcp:8200'
[UiAutomator2] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running 'D:\Android\android-sdk\platform-tools\adb.exe -P 5037 -s
VBJ4C18517001054 shell settings delete global hidden_api_policy_pre_p_apps'
[debug] [ADB] Running 'D:\Android\android-sdk\platform-tools\adb.exe -P 5037 -s
VBJ4C18517001054 shell settings delete global hidden_api_policy_p_apps'
[debug] [ADB] Running 'D:\Android\android-sdk\platform-tools\adb.exe -P 5037 -s
VBJ4C18517001054 shell settings delete global hidden_api_policy'
[BaseDriver] Shutting down because we waited 60 seconds for a command
[debug] [UiAutomator2] Deleting UiAutomator2 session
[Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired.
Try customizing the timeout using the 'newCommandTimeout' desired capability'
[Appium] Removing session ecf0d7f1-2aa5-43df-9bf0-15b7aadb3bde from our master s
ession list
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://localhost:8201/wd/hub/s
ession/fe47fbae-fbd3-4606-9165-fc79056c8b67] with no body
[WD Proxy] Got an unexpected response: {"code":"ECONNRESET"}

共收到 1 条回复 时间 点赞

解决了吗

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册