模拟触摸使用亚行 [英] simulating touch using ADB
问题描述
我试图发送使用批处理文件(.bat)的形式和亚洲开发银行的外壳触摸事件。
I am trying to send touch events using batch files (.bat) and the adb shell.
我试图重新发送我从亚行外壳getevents获取事件,即使命令传递没有错误这是行不通的。 任何想法?
I tried to re-send events I get from the adb shell getevents, and it doesn't work even though the command passes without errors. Any ideas?
如何模拟触摸事件和释放事件在给定的(X,Y)坐标利用亚洲开发银行的壳呢?
How do I simulate a touch-event and release-event on a given (x,y) coordinate using the ADB shell?
推荐答案
因为它似乎取决于Android版本改变,我建议你遵循以下说明:
Since it seems to change depending on the Android version, I suggest you to follow these instructions :
- 在开始转储运动事件中,你需要复制:
〜$ ADB壳getevent | grep的EVENT2
~$ adb shell getevent | grep event2
的grep是非常有用的过滤输出。
grep is very useful to filter output.
-
你想重现移动事件;
Do motion event you want to reproduce;
然后,只需将所有值从十六进制的转储为十进制值! :)
Then just convert all values from hex in dump to decimal values! :)
要查找eventX正在你就以下内容:
To find what eventX is working for you do following:
- 启动终端输入
〜$亚行外壳getevent
~$ adb shell getevent
您会看到快速移动的痕迹与例如/ dev /输入/ event4 ......
You will see quickly moving traces with for example /dev/input/event4 ......
- 在触摸屏一次
您必须用鼠标右键在触摸的瞬间event4几个eventX这些eventX间看到
You must see between event4 few eventX and these eventX right in the moment of the touch
将是你输入接口,用于再现移动事件! :)
will be yours input interface for reproducing motion events! :)
来源: <一href="http://softteco.blogspot.com/2011/03/android-low-level-shell-click-on-screen.html">http://softteco.blogspot.com/2011/03/android-low-level-shell-click-on-screen.html
希望它能帮助!
这篇关于模拟触摸使用亚行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!