[uiautomator2]python3使用uiautomator2实现安卓app自动化demo

  1. 传送门:uiautomator2环境搭建
  2. 源码地址:uiautomator2源码地址
# -*- coding: utf-8 -*-
# 1.安装 uiautomator2 使用命令:python -m pip install -U uiautomator2
# 2. 如下demo就可以使用uiautomator2的api写自动化用例了

import uiautomator2 as u2
from time import sleep


def main():
    # 手机的serial num 或者手机的IP
    d = u2.connect('CLB0219521000711')
    print(d.info)
    # 启动App
    d.app_start("com.tencent.news")
    sleep(10)
    d(text="视频").click()


if __name__ == '__main__':
    main()

猜你喜欢

转载自blog.csdn.net/weixin_45329445/article/details/113801831