[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
卸载重装 vivo 手机上的 appium 驱动应用,包括如下几个:
- io.appium.settings
- io.appium.uiautomator2.server
- io.appium.uiautomator2.server.test
02-29 09:43:32.216 28683 28944 I appium : Waiting up to 10000ms for device to be idle
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
罪魁祸首暴露啦 ~~~~ Force stopping io.appium.uiautomator2.server appid=10271 user=0: stop by com.vivo.abe
原来是这个家伙 com.vivo.abe 杀掉了 io.appium.uiautomator2.server 进程
在网上查了一下 com.vivo.abe 是 vivo 系统自带的应用 - 智能助手,不能删除也不能强制停止,它会自动扫描系统应用,把认为有问题的应用强制杀掉。如果有应用被它误杀,可以通过添加白名单的方法跳过检查。 配置的位置在 设置 -> 电池 -> 后台高耗电, 把 appium 相关的 app 都加上,然后再运行 appium 自动化测试,妥妥的没有问题啦
配置方法:
最后运行成功啦: