Adi*_*iti 6 android exception driver appium-android
如果我运行 TestNG 测试类,它会显示错误 ------------
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.
Original error: Could not proxy command to remote server. Original error: Error: socket hang up (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 281 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'MON-PC305', ip: '10.101.0.119', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{appPackage=com.app.android.game.app, statBarHeight=84, noReset=false, viewportRect={top=84, left=0, width=1440, height=2308}, deviceName=emulator-5554, platform=LINUX, deviceUDID=emulator-5554, desired={app="app path", appPackage=com.app.android.game.app, appActivity=com.app.android.game.app.activities.login.riskWarningLogin.RiskWarningLoginActivity, noReset=false, automationName=uiautomator2, skipUnlock=true, platformName=Android, deviceName=emulator-5554}, platformVersion=9, webStorageEnabled=false, automationName=uiautomator2, takesScreenshot=true, skipUnlock=true, javascriptEnabled=true, platformName=Android, deviceApiLevel=28, deviceManufacturer=Google, app=C:\Users\***\eclipse-workspace\appname\app.apk, deviceScreenSize=1440x2560, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, appActivity=com.app.android.game.app.activities.login.riskWarningLogin.RiskWarningLoginActivity, pixelRatio=3.5, locationContextEnabled=false, deviceScreenDensity=560, deviceModel=Android SDK built for x86}]
Session ID: d275d496-08b0-4652-9aa9-67ae0476cdc8
Run Code Online (Sandbox Code Playgroud)
小智 25
停止 appium 服务器并执行以下命令:
adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test
Run Code Online (Sandbox Code Playgroud)
然后重新启动 appium 服务器并执行您的脚本。
小智 0
不确定是否相同,但是当我通过uiautomator2运行appium自动化时,我在vivo手机上遇到了类似的问题。appium错误日志是这样的
[debug] [W3C (9ae907c5)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
[debug] [W3C (9ae907c5)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:261:13)
[HTTP] <-- POST /wd/hub/session/9ae907c5-5319-4f0b-92dc-fdaa47cfdcc5/element 500 139 ms - 530
Run Code Online (Sandbox Code Playgroud)
我这边的原因是 io.appium.uiautomator2.server 被系统进程 com.vivo.abe 杀死,因为我从 logcat 捕获了以下日志
02-29 09:43:32.236 1742 15589 I ActivityManager: Force stopping io.appium.uiautomator2.server appid=10271 user=0: stop by com.vivo.abe
02-29 09:43:32.236 701 701 E ANDR-IOP: IOP HAL: Received pkg_name = io.appium.uiautomator2.server pid = 0
02-29 09:43:32.237 1742 15589 I ActivityManager: Killing 28683:io.appium.uiautomator2.server/u0a271 (adj 0): stop by com.vivo.abe
02-29 09:43:32.239 701 701 E ANDR-IOP: IOP HAL: Received pkg_name = io.appium.uiautomator2.server pid = 0
Run Code Online (Sandbox Code Playgroud)
com.vivo.abe(名称为Vivo Wisdom引擎)是vivo手机上的系统应用程序,无法卸载或强制停止。有一个解决方案可以解决这个问题,只需将io.appium.uiautomator2.server添加到白名单中,那么com.vivo.abe就不会再次对应用程序执行kill。
方法是设置 -> 电池 -> 高后台功耗,然后将 io.appium.uiautomator2.server 添加到允许列表中。
我执行该操作后,io.appium.uiautomator2.server将不会再次被杀死,并且自动化脚本可以顺利运行。
希望能为解决问题提供一些参考。
| 归档时间: |
|
| 查看次数: |
54628 次 |
| 最近记录: |