Oce*_*lot 10 android adb swipe swipe-gesture
我试图在adb的帮助下重现滑动动作.目前,此代码有效(用于滑动)
adb shell input touchscreen swipe 530 1420 530 1120
adb shell input touchscreen swipe 530 1120 830 1120
Run Code Online (Sandbox Code Playgroud)
是的
adb shell input touchscreen swipe x1,y1, x2,y2
Run Code Online (Sandbox Code Playgroud)
但它们是两个不连续的滑动..它相当于第一次滑动,将你的手从屏幕上移开并进行第二次滑动等等.
我希望能够实现这一点作为一次轻扫..就像,想象一个游戏,在下面的热火,你必须拖动om-nom跨越各种障碍,而不用手指离开om-nom ..用上面提到的adb swipe,可怜的om-nom将落入火中并成为烤制的om-nom.:(
就像是
adb shell input touchscreen swipe [(x1,y1, x2,y2), (x3,y3, x4,y4)...(xn-1,yn-1, xn,yn)]
Run Code Online (Sandbox Code Playgroud)
如果不是adb,还有其他选择吗?
小智 9
你可以在亚行做到这一点.使用getevent记录您的手动输入:
adb shell getevent
Run Code Online (Sandbox Code Playgroud)
或者录制特定设备:
adb shell getevent /dev/input/eventx
Run Code Online (Sandbox Code Playgroud)
然后模拟录制的输入:
adb shell sendevent /dev/input/eventx
Run Code Online (Sandbox Code Playgroud)
adb shell "input touchscreen swipe 126 459 413 472 & input command touchscreen swipe 413 472 407 769"
Run Code Online (Sandbox Code Playgroud)
您必须在 android 设备输入命令中运行,才能继续在输入命令之间交换 add &,示例如下:
adb shell "
input touchscreen swipe 126 459 413 472 1000 & \ # 1th line
input touchscreen swipe 413 472 72 776 1000 & \ # 2th line
input touchscreen swipe 72 776 407 769 1000 | echo done # 3th line"
126 459 = 302 446 = 413 472
===================================
112 599 = 268 613 = 470 612
===================================
72 776 = 263 802 = 407 769
input touchscreen swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
Run Code Online (Sandbox Code Playgroud)
但需要在命令之间进行暂停或延迟(睡眠、等待),以便更精确地滑动。
| 归档时间: |
|
| 查看次数: |
19853 次 |
| 最近记录: |