MR_Android view client source code(1)
来源:互联网 发布:psv自制软件 编辑:程序博客网 时间:2024/04/29 20:28
#-*-coding:utf-8 -*-
#! /usr/bin/env monkeyrunner
'''
Copyright (C) 2012 Diego Torres Milano
Created on May 5, 2012
@author: diego
'''
import sys
import os
# this must be imported before MonkeyRunner and MonkeyDevice,
# otherwise the import fails
'''try:
ANDROID_VIEW_CLIENT_HOME = os.environ['ANDROID_VIEW_CLIENT_HOME']
except KeyError:
print >>sys.stderr, "%s: ERROR: ANDROID_VIEW_CLIENT_HOME not set in environment" % __file__
sys.exit(1)
'''
ANDROID_VIEW_CLIENT_HOME = os.environ['ANDROID_VIEW_CLIENT_HOME']
sys.path.append(ANDROID_VIEW_CLIENT_HOME + '/src')
from com.dtmilano.android.viewclient import ViewClient
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
'''device=MonkeyRunner.waitForConnection(20, 'emulator-5554')
if not device:
raise Exception('Cannot connect to device')
MonkeyRunner.sleep(5)
'''
package="com.aaa.bbb"
activity="com.aaa.bbb.LaunchActivity"
runComponent=package+'/'+activity
device, serialno = ViewClient.connectToDeviceOrExit(20, 'emulator-5554')
device.startActivity(component=runComponent)
MonkeyRunner.sleep(5)
vc = ViewClient(device,serialno)
vc.dump()
print 'hello'
address= vc.findViewById('id/img_search')
address.touch()
#! /usr/bin/env monkeyrunner
'''
Copyright (C) 2012 Diego Torres Milano
Created on May 5, 2012
@author: diego
'''
import sys
import os
# this must be imported before MonkeyRunner and MonkeyDevice,
# otherwise the import fails
'''try:
ANDROID_VIEW_CLIENT_HOME = os.environ['ANDROID_VIEW_CLIENT_HOME']
except KeyError:
print >>sys.stderr, "%s: ERROR: ANDROID_VIEW_CLIENT_HOME not set in environment" % __file__
sys.exit(1)
'''
ANDROID_VIEW_CLIENT_HOME = os.environ['ANDROID_VIEW_CLIENT_HOME']
sys.path.append(ANDROID_VIEW_CLIENT_HOME + '/src')
from com.dtmilano.android.viewclient import ViewClient
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
'''device=MonkeyRunner.waitForConnection(20, 'emulator-5554')
if not device:
raise Exception('Cannot connect to device')
MonkeyRunner.sleep(5)
'''
package="com.aaa.bbb"
activity="com.aaa.bbb.LaunchActivity"
runComponent=package+'/'+activity
device, serialno = ViewClient.connectToDeviceOrExit(20, 'emulator-5554')
device.startActivity(component=runComponent)
MonkeyRunner.sleep(5)
vc = ViewClient(device,serialno)
vc.dump()
print 'hello'
address= vc.findViewById('id/img_search')
address.touch()
- MR_Android view client source code(1)
- MR_Android view client source code(2)
- MR_Android View Client 问题总结及代码片段
- MR_ Android view client source code(3)---获取当前view id的名称
- Ftp Client source code, VC++6.0, MFC.
- Ftp Client source code, VC++6.0, MFC.
- vsftpd ftp client pwd implementation source code
- View android source code in Eclipse
- View the android source code in Eclipse
- View android source code in eclipse
- Smart Client Case Study Source Code Download from MSDN China
- Smart Client Case Study Source Code Download from MSDN China
- vsftpd ftp client ls command implementation source code
- view class source code with JAD plugin in Eclipse
- Workaround to view unavailable Android SDK 26 source code
- BeansDB Source Code Reading (1)
- Ceilometer Source code ---- page 1
- 2014-9-1 source code
- jquery实现的三级联动地区 jquery插件
- 判断读者浏览器类型和屏幕分辨率,自动调用不同CSS
- Lucene搜索过程解析(3)
- 鸟哥的Linux私房菜之获取管理员权限
- 继承
- MR_Android view client source code(1)
- 茅台称塑化剂事件为阴谋
- 苹果微软驱逐接班人 乔布斯门徒劫数难逃?
- 分享微博
- Xcode 4.1/4.2/4.3/4.4/4.5 + iOS 5.1.1免证书(iDP)开发+真机调试+生成IPA全攻略
- mysq怎么快速删除大量数据
- Struts2标签的的一些用法
- 在后台取前台Div或Table的innerHTML或innerText问题
- SCADA系统如何过渡物联网