monkeyrunner多点触摸

思路是:在屏幕上某个位置按着不放:device.touch(x,y,md.DOWN)

然后再做一个滑动的操作:device.drap((x1,y1),(x2,y2),0.2,10)

然后再松开按键:device.touch(x,y,md.UP)

#codeing:utf-8
from com.android.monkeyrunner import MonkeyRunner as mr ,MonkeyDevice as md  
device=mr.waitForConnection()

#点击“Home键”
print '------------------Back Home Screen-------------------------------------'
device.press('KEYCODE_HOME',md.DOWN_AND_UP)
mr.sleep(1)

#打开“更多设置”
print '------------------Open More Settings-------------------------------------'
device.touch(87,1516,md.DOWN)
mr.sleep(1)
device.drag((931,412),(560,956),0.5,5)
device.touch(87,1516,md.UP)

 

posted @ 2016-12-11 20:50  小水皮  阅读(920)  评论(0编辑  收藏  举报