解决Appium报错read ECONNRESET

时间:2024-02-22 13:00:22

报错信息如下:

error: Unhandled error: Error: read ECONNRESET
    at exports._errnoException (util.js:837:11)
    at TCP.onread (net.js:544:26) context: [POST /wd/hub/session {"desiredCapabi
lities":{"appPackage":"com.tencent.mm","appActivity":".ui.LauncherUI","recreateC
hromeDriverSessions":true,"noReset":true,"platformVersion":"4.4","unicodeKeyboar
d":"false","fastReset":"f]
info: [debug] Logcat terminated with code 0, signal null
info: [debug] UiAutomator exited

问题原因:该错误为端口扫描问题,如果某个端口无法通信(可能被防火墙过滤了也可能被其它软件占用),就会报这种错误。

解决办法:卸载本地环境杀毒软件,重启电脑。