Development.apk->“指针位置”日志:
03-02 17:22:28.050: I/Pointer(24911): Pointer 1: DOWN (400.0, 700.0) Pressure=0.0 Size=0.0 TouchMajor=0.0 TouchMinor=0.0 ToolMajor=0.0 ToolMinor=0.0 Orientation=0.0deg VScroll=0.0 HScroll=0.0
使用monkeyrunner模拟“拖动”时的压力始终为0.0。 如何增加压力?
答案 0 :(得分:-1)
试试这个:
from com.android.monkeyrunner import MonkeyDevice, MonkeyRunner, MonkeyView, MonkeyImage
my_device = MonkeyRunner.waitForConnection()
my_device.drag((350,600),(50,600),0.05,50) #dragging screen to right
这会将屏幕向右拖动。 起始坐标:x1 = 350 y1 = 600 精加工坐标:x2 = 50 y2 = 600