adb sendevent
是一个 Android Debug Bridge (ADB) 命令,用于模拟触摸屏事件
adb shell input tap <x> <y>
命令来获取当前屏幕上的点击坐标,例如:adb shell input tap 100 200
adb shell input event
命令模拟鼠标事件。你需要根据你想要模拟的事件类型(按下、移动、抬起)提供相应的参数。以下是一些示例:adb shell input event --action=1 --pointerId=1 --x=100 --y=200
adb shell input event --action=3 --pointerId=1 --x=150 --y=250
adb shell input event --action=0 --pointerId=1 --x=150 --y=250
在这些示例中,--action
参数表示事件类型(1 表示按下,3 表示移动,0 表示抬起),--pointerId
参数表示鼠标指针的 ID(通常为 1),--x
和 --y
参数表示鼠标事件发生的坐标。
你可以根据需要组合这些命令来模拟复杂的鼠标事件序列。例如,先按下鼠标按钮,然后移动鼠标,最后抬起鼠标按钮:
adb shell input event --action=1 --pointerId=1 --x=100 --y=200
adb shell input event --action=3 --pointerId=1 --x=150 --y=250
adb shell input event --action=0 --pointerId=1 --x=150 --y=250
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>