Wednesday, August 17, 2011

adbでタッチイベントを発生させる



http://stackoverflow.com/questions/4386449/send-touch-event-from-adb-to-a-device

To send touch event you need to do:

1 Set coordinates:

adb shell sendevent /dev/input/event2 3 0 x
adb shell sendevent /dev/input/event2 3 1 y
2 Send touch event (must have 0 0 0 pair):

adb shell sendevent /dev/input/event2 1 330 1
adb shell sendevent /dev/input/event2 0 0 0
3 Send release finger event (must have 0 0 0 pair):

adb shell sendevent /dev/input/event2 1 330 0
adb shell sendevent /dev/input/event2 0 0 0
Please note:

1 You can record events:

adb shell getevent
2 if you use getevent all event values are in hex.

Best regards, Yahor





No comments:

Post a Comment