搞了好久,appium 启动一直报错。
各种错,比如:
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","192.168.0.4:5555","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[WD Proxy] Got an unexpected response: {"errno":-4077,"code":"ECONNRESET","syscall":"read"}
比如:
[debug] [ADB] Running 'D:\003-soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 192.168.0.4\:5555 forward --remove tcp\:8200'
[UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command 'D\:\\003-soft\\android-sdk-windows\\platform-tools\\adb.exe -P 5037 -s 192.168.0.4\:5555 forward --remove tcp\:8200' exited with code 1'; Stderr: 'error: listener 'tcp:8200' not found'; Code: '1''
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1659668519002 (11:01:59 GMT+0800 (中国标准时间))
安装在设备上的appium.setting 手动也打不开,一直以为是这个原因。
尝试重新卸载安装appium 和node版本,仍然不行。最后,把代码里:
if automation_name =='UiAutomator2': desired_cap['uiautomator2ServerInstallTimeout'] = 20000 这个时间由9000改到20000 就好了。启动成功了。搞了一个星期的问题,终于好了。。