首先windows安装python3+,以及PyCharm
windows安装相关包:
pip install --pre uiautomator2
这里安装雷电模拟器,这里要记住,要用雷电模拟器自带的adb
where adb

启动雷电模拟器,开启开发者选项,以及USB调试,以及配置下模拟器IP地址。

重启下adb
- adb kill-server
- adb start-server

再查询是否检测到设备:
adb devices
查询到了,再安装ATX。
python -m uiautomator2 init
安装完后,会有这个图标:

点开他,按下:

发现启动不了。

这里直接进入shell,操作手机,进行打开。
- adb shell
- chmod 775 /data/local/tmp/atx-agent
- /data/local/tmp/atx-agent server -d (添加-d表示在后台动)
这样就打开了。不会提示Uiautomator not starting
下面安装weditor
pip install --pre -U weditor
然后启动
weditor

输入IP地址,点击Connect就可以连接了,下面的 代码是测试,可以启动APP
- import uiautomator2 as u2
-
- d = u2.connect_wifi("192.168.1.100")
- d.app_start("com.sinovatech.unicom.ui")
-
-
- if __name__ == "__main__":
- pass
下面介绍个adb命令,查询当前界面的包名
adb shell am monitor





![战神引擎传奇手游【1.76盛战传奇免授权版[摸摸登陆器]】最新整理Win系复古服务端+安卓苹果双端+GM授权物品后台+详细搭建教程](https://cdn.jxasp.com:9143/image/20251106/1B4E8594B3BEB90E8601D63A8A39CB0B.jpg)













