一、需要安装内容
- app-uiautomator.apk
- app-uiautomator-test.apk
- atx-agent
- minicap
- minitouch
二、自动安装
python -m uiautomator2 init
三、手动安装
1、安装apk
wget https://github.com/openatx/android-uiautomator-server/releases/download/$VERSION/app-uiautomator.apk
wget https://github.com/openatx/android-uiautomator-server/releases/download/$VERSION/app-uiautomator-test.apk
adb install app-uiautomator.apk
adb install app-uiautomator-test.apk
2、安装atx-agent
VERSION=0.9.5 # 请换成最新版本
wget https://github.com/openatx/atx-agent/releases/download/$VERSION/atx-agent_$VERSION_linux_armv6.tar.gz
tar -xzvf atx-agent_$VERSION.tar.gz
adb push atx-agent /data/local/tmp/
adb shell chmod 755 /data/local/tmp/atx-agent
# 注: 如果在/data/local/tmp 目录不好使,就push到/data/data/com.android.shell目录下
/data/local/tmp/atx-agent version # 查看版本
/data/local/tmp/atx-agent server -d # # 启动atx-agent并切换到后台运行
3、安装minitoch和minicap
#进入相应的文件目录下
adb push minicap /data/local/tmp
adb push minicap.so /data/local/tmp
adb push minitouch /data/local/tmp
4、卸载
adb shell rm /data/local/tmp/minicap
adb shell rm /data/local/tmp/minicap.so
adb shell rm /data/local/tmp/minitouch
adb shell /data/local/tmp/atx-agent server --stop
adb shell rm /data/local/tmp/atx-agent
adb uninstall com.github.uiautomator
adb uninstall com.github.uiautomator.test