python3 -m uiautomator2 init 报错解决

今天想学习下uiautomator2 模块,但是第一步就卡住了,python3 -m uiautomator2 init 初始化的时候报错了,报错信息如下
image.png
主要是 ConnectionRefusedError: [Errno 61] Connection refused 连接被拒绝。
解决办法 卸载原来的uiautomator2 模块 重新安装 然后在执行 python3 -m uiautomator2 init

问题解决
卸载

pip3 uninstall   uiautomator2

image.png

重装

 pip3 install --pre uiautomator2 

image.png
最后

 python3 -m uiautomator2 init

image.png

原文地址:https://www.cnblogs.com/wzbk/p/14240049.html