uiautomator2+雷电模拟器

1.雷电模拟器设置网络桥接

2.安装uiautomator2

pip install --pre uiautomator2

pip install pillow

3.初始化

python -m uiautomator2 init

安装完成,设备上会多一个ATX的应用。

打开之后可以看到手机IP

4.weditor 网页查看控件

# 安装
pip install --pre --upgrade weditor
# 使用
Python3 -m weditor

在页面左上角选择Android,输入设备IP(192.168.1.102),点击Connect按钮。

5.Python连接手机

import uiautomator2

uiautomator2.connect_wifi('192.168.1.102')
原文地址:https://www.cnblogs.com/wtil/p/12623264.html