当前位置:   article > 正文

ADB模拟点击、滑动事件_adb 滑动

adb 滑动

ADB 模拟点击、滑动事件

方案一:使用input子系统

1.adb shell input tap position_x position_y

tap模拟点击事件
position_x 为点击的横坐标,position_y 为点击的纵坐标
ps: 此方法需要知道点击的坐标值,可以打开设置-开发者选项中的报点和指针位置,辅助判断;也可以通过adb shell getevent -l ,查看ABS_MT_POSITION_X和ABS_MT_POSITION_Y获取,其中value值为000001d3和 000008d5,均为十六进制,可以通过转换器换算成十进制。
在这里插入图片描述
示范:adb shell input tap 140 2260

2.abd shell input swipe from_x from_y to_x to_y

swipe模拟滑动事件。可以左右滑动,可以上下滑动
from_x 为滑动起始横坐标,from_y 为滑动起始纵坐标
to_x 为滑动终点横坐标, to_y 为滑动终点纵坐标
示范:
左右滑动:adb shell input swipe 1065 1400 829 1537
上下滑动:adb shell input sw

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/56393
推荐阅读
相关标签
  

闽ICP备14008679号