Skip to content

Uiautomator2的kotlin版本(目前可以使用基本能,开发文档还没写,可以参考下test开发)

Notifications You must be signed in to change notification settings

tomlezen/TUiautomator

Repository files navigation

TUiautomator - uiautomator2的kotlin版本(仅供学习参考)

TUiautomator是根据自己需求,参照uiautomator2翻译的kotlin版本,只翻译了常用、需求高的api 翻译的初衷是:

  1. uiautomator2是python语言开发,自己py语法不熟悉,用起来不是很顺手
  2. uiautomator2不能单独在手机运行,也就不能手动的开启和关闭脚本运行
  3. 可以用Uiautomator2开发app,完成自主控制运行

安装环境

  1. 安装uiautomator2

    pip install --upgrade --pre uiautomator2
    
  2. 安装程序到手机 确保adb已经添加到环境变量中,执行下面的命令会自动安装本库所需要的设备端程序:uiautomator-serveratx-agentopenstf/minicapopenstf/minitouch

    # init 所有的已经连接到电脑的设备
    python -m uiautomator2 init
    

    有时候init也会出错,请参考手动Init指南

  3. 【可选】安装weditor (个人推荐安装,因为在写程序时方便测试)

    pip install -U weditor
    

    命令行启动 python -m weditor 会自动打开浏览器,输入设备的ip或者序列号,点击Connect即可

以上的配置均可以参考uiautomator2文档

About

Uiautomator2的kotlin版本(目前可以使用基本能,开发文档还没写,可以参考下test开发)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages