是否可以在Android上使用adb在触摸屏上进行连续的滑动操作? [英] Is it possible to produce continuous swipe action on the touchscreen, with adb, on Android?

查看:2031
本文介绍了是否可以在Android上使用adb在触摸屏上进行连续的滑动操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在adb的帮助下重现滑动操作。
当前,此代码有效(适用于滑动)

I'm trying to reproduce swipe action, with the help of adb. Currently, this code works (for swipe)

adb shell input touchscreen swipe 530 1420 530 1120
adb shell input touchscreen swipe 530 1120 830 1120

adb shell input touchscreen swipe x1,y1, x2,y2

,但它们是两次不连续的滑动。这等效于第一次滑动,将您的手从屏幕上移开,然后进行第二次滑动,依此类推。

but they are two discontinuous swipes.. Its equivalent to doing the first swipe, take ur hand off the screen and do the second swipe and so on..

我想通过一次滑动就可以实现这一点。
例如,想象一个游戏,在其下有烈火,您必须拖动 om-nom 跨越各种障碍,而不必动弹 om-nom ..,上面提到的adb滑动,可怜的 om-nom 将掉入大火,成为 roasted-om-nom 。 :(

I would like to achieve this as a single swipe.. Like, imagine a game where theres hot fire underneath and you have to drag om-nom across various obstacles without taking your finger off om-nom.. with the above mentioned adb swipe, poor om-nom would fall into the fire and become roasted-om-nom. :(

类似

adb shell input touchscreen swipe [(x1,y1, x2,y2), (x3,y3, x4,y4)...(xn-1,yn-1, xn,yn)]

如果不是adb,还有其他替代方法吗?

if not adb, any other alternative?

推荐答案

adb shell getevent

或记录特定设备:

adb shell getevent /dev/input/eventx

然后使用以下命令模拟记录的输入:

Then simuate recorded input with:

adb shell sendevent /dev/input/eventx

这篇关于是否可以在Android上使用adb在触摸屏上进行连续的滑动操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆