[uiautomator2]python3使用uiautomator2实现安卓app自动化demo
作者:互联网
- 传送门:uiautomator2环境搭建
- 源码地址: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()
标签:__,demo,app,源码,uiautomator2,main 来源: https://blog.csdn.net/weixin_45329445/article/details/113801831