MonkeyRunner_Android view client的配置
来源:互联网 发布:注册域名几天可以交易 编辑:程序博客网 时间:2024/04/30 10:09
在monkey runner中使用android view client
1.下载 Android view client
https://github.com/dtmilano/AndroidViewClient
2.解压到本地,然后配置ANDROID_VIEW_CLIENT_HOME
在ubuntu 下打开terminal,然后输入vim ~/.bashrc,添加如下设置
export ANDROID_VIEW_CLIENT_HOME=/home/xxx/monkeyrunner/AndroidViewClient-master/AndroidViewClient
3.打开模拟器,然后执行脚本dump.py
输入命令如下:
cd AndroidViewClient
cd examples
./dump.py
运行结果如下:
/home/xxx/monkeyrunner/AndroidViewClient-master/AndroidViewClient/src/com/dtmilano/android/viewclient.py:1013: UserWarning: Running on emulator but no serial number was specified then 'emulator-5554' is used
warnings.warn("Running on emulator but no serial number was specified then 'emulator-5554' is used")
com.android.internal.policy.impl.PhoneWindow$DecorView NO_ID None
android.widget.FrameLayout id/content None
com.android.launcher2.DragLayer id/drag_layer None
com.android.launcher2.AllApps2D id/all_apps_view None
android.widget.GridView id/all_apps_2d_grid None
com.android.launcher2.AllApps2D$HomeButton id/all_apps_2d_home None
com.android.launcher2.Workspace id/workspace None
com.android.launcher2.CellLayout id/cell1 None
com.android.launcher2.CellLayout id/cell2 None
com.android.launcher2.CellLayout id/cell3 None
com.android.launcher2.LauncherAppWidgetHostView id/0xc0000 None
android.widget.LinearLayout id/0x7f0b0017 None
android.widget.ImageButton id/0x7f0b000d None
android.widget.TextView id/0x7f0b0018
android.widget.ImageButton id/0x7f0b0019 None
com.android.launcher2.LauncherAppWidgetHostView id/0xc0001 None
android.widget.RelativeLayout id/icon None
android.widget.ImageView id/horizontal None
android.widget.RelativeLayout id/vertical None
android.widget.TextView NO_ID Home
android.widget.TextView NO_ID .
android.widget.TextView id/all_apps_view 1
android.widget.ImageView id/all_apps_2d_grid None
android.widget.TextView id/all_apps_2d_home See
android.widget.TextView id/name Touch
com.android.launcher2.CellLayout id/cell4 None
com.android.launcher2.LauncherAppWidgetHostView id/0xd0000 None
android.widget.LinearLayout NO_ID None
android.widget.LinearLayout integer/config_allAppsFadeInTime None
android.widget.TextView integer/config_allAppsFadeOutTime
android.widget.TextView integer/config_allAppsBatchLoadDelay Touch
android.widget.ImageView NO_ID None
android.widget.ImageButton integer/config_allAppsBatchSize None
android.widget.ImageView NO_ID None
android.widget.ImageButton id/0x7f0a0004 None
com.android.launcher2.CellLayout id/cell5 None
android.widget.ImageView id/previous_screen None
android.widget.ImageView id/next_screen None
com.android.launcher2.DeleteZone id/delete_zone None
android.widget.RelativeLayout id/all_apps_button_cluster None
com.android.launcher2.HandleView id/all_apps_button None
android.widget.ImageView id/hotseat_left None
android.widget.ImageView id/hotseat_right None
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Verifying environment setup
Before you begin, you can verify that your environment has been correctly setup after following the steps mentioned in Installation.
There is a simple script in examples that would help you do this verification.
$ cd /path/to/androidviewclient$ cd AndroidViewClient$ cd examples$ monkeyrunner check-import.py
if everything is fine, you will receiver
sys.path= ['/opt/android-sdk/tools/lib/monkeyrunner.jar', '/home/user/tmp/test/AndroidViewClient-master/AndroidViewClient/examples', '/opt/android-sdk-linux/tools/lib/Lib', '/opt/android-sdk-linux/tools/lib/jython-standalone-2.5.3.jar/Lib', '__classpath__', '__pyclasspath__/', '/home/user/tmp/test/AndroidViewClient-master/AndroidViewClient/src']OK
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AndroidViewClient配置步骤
- The shebang line to invoke monkeyrunner interpreter if you are using Linux or Mac OS X. Unfortunately this is not available on Windows. Eclipse does not use this line but is needed if you want to simplify the way you are running the scripts from the command line.
- Some standard imports
- PyDev uses PYTHONPATH whilemonkeyrunner ignores it. This snippet adds the components present inPYTHONPATH to sys.path and makes them visible to monkeyrunner.
- Following, we need to locate AndroidViewClient which you should have added to the environment. This can be also added inEclipse in Run Configurations -> Environment.
ANDROID_VIEW_CLIENT_HOME should point to your AndroidViewClient installation to the parent folder ofsrc. That is, if you have downloadedAndroidViewClient in /opt/AndroidViewClient and kept the same structure as the distribution, you should setANDROID_VIEW_CLIENT_HOME=/opt/AndroidViewClient/AndroidViewClient - The imports, which will now succeed because sys.path contains the right components
- Gets the device's serial number from the command line or default to emulator-5554.
- Connect to the device
- Check if the connection was successful. Because MonkeyRunner.waitForConnection() returns a MonkeyDevice even when the connection fails we need to go to this extra step to verify it.
- MonkeyRunner_Android view client的配置
- 配置client的相关工作
- MFC在VIEW的Client区绘制图形
- openVPN的客户端的client.ovpn配置.
- AIX nim 备份client rootvg 的配置
- Oracle 11g client的配置
- SQuirreL SQL Client的安装与配置
- ORACLE INSTANT CLIENT和PLSQL的配置
- MR_ Android view client source code(3)---获取当前view id的名称
- vmware-view-client for ubuntu
- [Oracle Client and Net Service]Oracle Client安装及Net Service的配置
- CAS client客户端的配置,使用java config的方式
- 配置NIS client
- perforce 配置client端
- CAS client配置示例
- Oracle Instant Client 配置
- 配置client服务器环境
- LINUX ORACLE CLIENT配置
- android 完全退出程序
- 在hibernate+mysql:Field 'id' doesn't have a default value两种解决办法
- 十六周上机任务(字符串)
- [Error Fix] The transaction log for database 'DATABASENAME' is full
- glBlendFunc()的参数(转自CSDN)
- MonkeyRunner_Android view client的配置
- DEDECMS网站数据快速迁移、数据库备份和还原
- java生成newid随机数
- C++的XML编程经验――LIBXML2库使用指南
- opencv cvhog详解
- 裸色调的旋律
- Serializable的必要条件
- jQuery的.live()和.die()
- centos 6.3 服务器环境配置(apach+php+mysql+phpmyadmin)