adb快速模拟点击方式
-
通过start_new_thread方式实现,本质上属于延迟点击,顺序准确性无法保证,非实时性的
import os from _thread import start_new_thread thread_count = 1 def click(x,y,duration=40): global thread_count def _click(x,y): global thread_count os.system(f"adb shell input tap {x} {y}") thread_count -=1 #print(f"{time.ctime()[11:19]} click: {x},{y}") thread_count +=1 start_new_thread(_click, (x,y)) duration = duration/1000 _duration = duration*thread_count/2 time.sleep(_duration if _duration > duration else duration*2)
- 通过adb shell monkey发送
- 通过adb shell getevent -p -l获取屏幕触碰