airinput
Simulate touch,drag,pinch for Android phone.
The lib of go-airinput
Distribution
I put a pre compiled file in dist folder
About the usage:
- use
run.batto push file to your phone. - open browser
http://:21000
Support post js code to http://
Example js code:
exec("input", "keyevent", "ENTER")
tap(20, 30, 100) // position: (20, 30), duration: 100ms
drag(10, 12, 50, 60, 10, 100) // start(10, 12), end(50, 60), steps: 10, duration: 100ms
// pinch(ax0, ay0, ax1, ay1, bx0, by0, bx1, by1, steps, duration)
Also support use adb to run js
adb shell /data/local/tmp/air-native -i /dev/input/event1 -runjs='tap(400, 400, 2000)'