python 快速触发adb 命令, 快速点击
import subprocess import time # 按照次数来点击它 def loop_click_for_android(run_num=30): res = subprocess.Popen('adb devices', shell=True, stdout=subprocess.PIPE) res.stdout.read() num = 0 node_time = time.time() start_buttun = subprocess.Popen("adb shell input tap 540 1104", shell=True, stdout=subprocess.PIPE) if start_buttun: while True: result = subprocess.Popen("adb shell input tap 540 1104", shell=True, stdout=subprocess.PIPE) if result: num += 1 if num == run_num: break else: continue over_time = time.time() print("{}次点击的运行时间是:{}".format(run_num, over_time-node_time)) # 次数统计并不准确 loop_click_for_android()
本文来自博客园,作者:沉迷编程的程序员,转载请注明原文链接:https://www.cnblogs.com/codeDevotee/p/15601005.html
欢迎各位找我代写程序,python、c#、web等都可以,加我请注明博客园微信:A15919195482
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步