python uiautomator

电脑连接上一个手机或多个手机, 确保adb已经添加到环境变量中,执行下面的命令会自动安装本库所需要的设备端程序:uiautomator-server 、atx-agent、openstf/minicap、openstf/minitouch

安装

安装uiautomator2
pip install --pre uiautomator2
pip install pillow
使用:
python -m uiautomator2 init
安装完成,设备上会多一个uiautomator的应用。

1、安装:
pip install --pre --upgrade weditor
2、使用:
python3 -m weditor

指令:
d.screen_on()#打开屏幕
d.screen_off()#关闭屏幕
d、press(“home”)#按home键,用键名
d、press(“back”)#按返回键,与主要的名称
d、unlock()解锁屏幕

原文地址:https://www.cnblogs.com/qev211/p/15419985.html