有三个可以实现:
1、uiautomator2
UiAutomator本来是Google提供的用来做安卓自动化测试的一个Java库,基于Accessibility服务。为了方便使用python,大牛开发了uiautomator2 ,uiautomator2是一个 Android Uiautomator2 Python 封装库,用于通过 Python 脚本进行 Android 设备的自动化测试。
github:https://github.com/openatx/uiautomator2
配合weditor来获取手机上元素的位置等信息
pip install -U weditor
2、Appium
Appium 是一个开源的自动化测试工具,支持多种平台的用户界面(UI)自动化,包括 iOS、Android、Tizen、Chrome、Firefox、Safari、macOS、Windows、Roku、tvOS、Android TV 和 Samsung 电视等。
https://github.com/appium/appium
3、autojs
Auto.js 是一个不需要 root 的自动化脚本开发工具,它基于无障碍服务,支持打包脚本为 APK,上手简单,适合懂 JS 的用户。 4.1 及之前的版本是开源免费的,github中是 Auto.js 自动化脚本的学习资源库,其中包含了各种好玩的脚本和教程,如微信删除僵尸好友、喵币领取、自动刷短视频等功能。
https://github.com/wiatingpub/autojs
网友回复