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')

 5. 如果atx提示 非 am instrument 那就使用adb链接上手机并使用以下命令启动atx

adb shell  /data/local/tmp/atx-agent server -d

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM