首页 > 其他 > 详细

脚本 uiautomator 简单使用

时间:2021-05-19 23:45:11      阅读:28      评论:0      收藏:0      [点我收藏+]
 1 # coding: utf-8
 2 import uiautomator2 as u2
 3 
 4 
 5 def main():
 6     d = u2.connect(127.0.0.1:5555)
 7     # 启动app并获取session
 8     app = d.session("<package name>")
 9     # app = d.session("")
10     # 执行shell命令,获取输出和exitCode
11     output, exit_code = d.shell("ps -A", timeout=60)
12     output = d.shell("pm list package").output
13     print(output)
14 
15 
16 if __name__ == __main__:
17     main()

 

脚本 uiautomator 简单使用

原文:https://www.cnblogs.com/spritegirl/p/14786484.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!