monkeyrunner和结束呼叫 [英] monkeyrunner and EndCall

查看:170
本文介绍了monkeyrunner和结束呼叫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MonkeyRunner与用户活动的模拟比赛。
所有罚款,但我不能preSS按结束。
为了让电话使用:

I'm using MonkeyRunner to play with simulation of user activity. All fine but I cannot press EndCall. To make call I use:

device.touch(190, 800, 'DOWN_AND_UP') 

X,呼叫按钮的y坐标。

x,y coordinates of CALL button.

但是,当我试图挂断我尝试:

But when I trying to hangup I try :

device.touch(230, 700, 'DOWN_AND_UP') 

X,Y - 相应坐标结束通话按钮。
没有happen.Trying preSS:

x,y - accordingly coordinates of End Call button. Nothing happen.Trying press:

device.press('KEYCODE_ENDCALL', 'DOWN_AND_UP')

同样的效果。现在尝试发送意图,但不知道该使用哪个结束呼叫意图。
我的设备在Android 2.2.1运行。

Same effect. Trying now to send intent but dont know which intent to use to EndCall. My device running on Android 2.2.1.

感谢。

推荐答案

这适用于2.3和WVGA模拟器:

This works on an emulator with 2.3 and WVGA:

#! /usr/bin/env monkeyrunner

from com.android.monkeyrunner import MonkeyRunner

def main():
    print "waiting for connection..."
    device = MonkeyRunner.waitForConnection()

    device.touch(140, 760)
    MonkeyRunner.sleep(15)
    print "dialing..."
    device.type('5551234')
    MonkeyRunner.sleep(3)
    device.touch(240, 740)
    MonkeyRunner.sleep(25)
    print "hanging up..."
    device.touch(240, 600)

if __name__ == '__main__':
    main()

这篇关于monkeyrunner和结束呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆