在手机上安装
QPython
GitHub上的下载链接在手机上打开
QPython
软件的Terminal
,安装uiautomator2
1
2# Since uiautomator2 is still developing, you have to add --pre to install development version
pip install --pre uiautomator2在手机上安装
app-uiautomator.apk
最新版下载链接导入最新版的
atx-agent
到手机中
最新版下载地址
下载以linux_armv7.tar.gz
结尾的二进制包。绝大部分手机都是linux-arm架构的。
解压出atx-agent
文件,导入到手机中并启动:1
2
3
4
5adb push atx-agent /data/local/tmp
adb shell chmod 755 /data/local/tmp/atx-agent
# launch atx-agent in daemon mode
adb shell /data/local/tmp/atx-agent -d
# example: server started, listening on 192.168.28.230:7912假设手机的地址是
$DEVICE_URL
(eg:http://192.168.28.230:7912
)无线访问手机系统
获取当前程序版本
1
2curl $DEVICE_URL/version
# expect example: 0.0.7安装应用
1
2curl -X POST -d url="http://some-host/some.apk" $DEVICE_URL/install
# expect example: install id1
2
3
4
5
6
7# get install progress
curl -X GET $DEVICE_URL/install/1
{"id":"1","totalSize":985435,"copiedSize":16951,"message":"downloading"}
# or
{"id":"1","totalSize":985435,"copiedSize":985435,"message":"success installed"}
# or
{"id":"1","totalSize":985435,"copiedSize":342641,"message":"error install","error":"exit status 1"}上传文件
1
2
3
4
5# 上传到/sdcard目录下 (url以/结尾)
curl -F "file=@somefile.txt" $DEVICE_URL/upload/sdcard/
# 上传到/sdcard/tmp.txt
curl -F "file=@somefile.txt" $DEVICE_URL/upload/sdcard/tmp.txt程序自升级
升级程序从gihub releases里面直接下载,升级完后自动重启1
2# 升级到最新版
curl 10.0.0.1:7912/upgrade1
2# 指定升级的版本
curl "$DEVICE_URL/upgrade?version=0.0.7"ATX Log Path
1
/sdcard/atx-agent.log
RESOURCE:
testerhome_10361
testerhome_10298
github_uiautomator2
github_android-uiautomator-server
github_atx-agent
github_qpython