一 前言
因为Weditor基于uiautomator2,所以定位效果还不错,当然也有部分元素定位不准确和定位不到的情况,不过一般情况下,用Weditor体验还是挺好的
二 安装
在windows电脑下安装
在要安装weditor的目录下右键选中在终端里打开,也可以先打开终端然后切换目录。在终端输入命令
git clone https://github.com/openatx/weditor
注意,github是国外的网站,如果发现下载不了,需要合法翻墙
以上命令执行成功后,会在当前目录下下载一个weditor文件夹,此时继续在终端输入命令:
pip3 install -e weditor
执行成功安装UIAutomator:
pip3 install --pre -U uiautomator2
将手机连接好(需要开启开发者模式,不会自行百度)
手机设备/模拟器环境初始化:
python3 -m uiautomator2 init
或者
python -m uiautomator2 init
Weditor控件安装:
pip3 install --pre weditor
运行Weditor:
python3 -m weditor
或者
python -m weditor
查看设备
adb device
连接设备,当Connect后出现麦穗,即表示连接成功