转自http://www.softteco.com/blog/android-low-level-shell-click-on-screen/
Guys, nowdays, approach in this article is really senseless.
Use: input tap x y
(also input text, swipe, keyevent are available)
adb shell input tap x y
adb shell input swipe x1 y1 x2 y2
adb shell input text Hello!
adb shell input keyevent ID
By this way you do not need to care about hardware implementation. Using events you will have to imeplemnt them for each device. All these commands could be executed on device or on PC via ADB.
Happy testing! (:
To send touch event you need to do:
1 Set coordinates:
adb shell sendevent/dev/input/event230x adb shell sendevent/dev/input/event231y
2 Send touch event (must have 0 0 0 pair):
adb shell sendevent/dev/input/event213301adb shell sendevent/dev/input/event2000
3 Send release finger event (must have 0 0 0