转载:monkey_recorder录制monkeyrunner脚本

 

1. 你必须有android sdk, sdk的tools文件家里有一个monkeyrunner.bat.
2. 将如下内容拷贝到一个文件内,例如我起个名字为 recorder.py.

#!/usr/bin/env monkeyrunner
# Copyright 2010, The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from com.android.monkeyrunner import MonkeyRunner as mr
from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder

device = mr.waitForConnection()
recorder.start(device)

3. cd到monkeyrunner.bat 的目录里, 运行 monkeyrunner.bat recorder.py

4. 我们看到了上面的画面, 电击或者选择按钮操作, 右边的一栏会把操作记录下来. 然后export 脚本文件.

5. ./monkeyrunner monkey_playback.py calc.mr (calc.mr 是上部导出的文件)

monkey_playback.py 的脚本内容见这里http://mirror.yongbok.net/linux/android/repository/platform/sdk/monkeyrunner/scripts/monkey_playback.py

转载自:http://blog.whoistester.com/monkey_recorder录制monkeyrunner脚本/

monkey_recorder录制monkeyrunner脚本的更多相关文章

  1. monkeyrunner脚本录制

    1.在窗口输入 monkeyrunner monkey_recorder.py  调用录制脚本工具 2.在窗口输入 monkeyrunner monkey_playback.py  d:\game   ...

  2. Monkeyrunner脚本的录制与回放

    继上一篇monkeyrunner环境搭建:http://www.cnblogs.com/zh-ya-jing/p/4351245.html 之后,我们可以进一步学习monkeyrunner了. 我也是 ...

  3. MonkeyRunner之小白如何使用MonkeyRecorder录制回放脚本

    之前摸索了好久.学习Python语言.安装工具.拉拉溜溜也慢慢地一点点进步.每天就疯狂的上网找资料.虽然大牛们写的很详细.但是自己就是笨的不知怎么做.最后找了一篇文章,真的就是万事俱备只欠东风的感觉, ...

  4. 【monkeyrunner】monkeyrunner脚本录制和回放

    脚本录制 1.连接你已经打开调试模式的ANDROID设备或模拟器,输入adb devices 2.运行录制脚本.在cmd窗口输入 monkeyrunner recorder.py #recorder. ...

  5. Android自动化学习笔记:编写MonkeyRunner脚本的几种方式

    ---------------------------------------------------------------------------------------------------- ...

  6. LR破解版录制手机脚本(一)模拟器录制

    最近在网上听到好多童鞋都在问如何用LR做手机性能测试,恰好自己对这方面也挺感兴趣,经过查阅很多资料,形成此文档以做备注~!如果有感觉我写的不对的地方,敬请指正,谢谢~!     其实自从LR12出来之 ...

  7. Android自动化学习笔记之MonkeyRunner:用Eclipse执行MonkeyRunner脚本

    Info: 初步学习,难免会有疏漏,以后我会不断修改补全,直到完美.转载请注明出处,谢谢. 2014-10-11: 初版 2014-10-16: 完善 ------------------------ ...

  8. monkeyrunner之eclipse中运行monkeyrunner脚本之环境搭建(四)

    monkeyrunner脚本使用Python语法编写,但它实际上是通过Jython来解释执行. Jython是Python的Java实现,它将Python代码解释成Java虚拟机上的字节码并执行,这种 ...

  9. LoadRunner11录制APP脚本(2)

    通过安卓模拟器实现LoadRunner11录制APP脚本 http://www.51testing.com/html/24/15110424-3686857.html http://www.51tes ...

随机推荐

  1. 关于 Uboot 中有趣的 0xdeadbeef 填充

    在 Uboot 的 Start.S 中存在以下源码: .globl _start _start: b start_code ldr pc, _undefined_instruction ldr pc, ...

  2. 第一册:lesson ninety-three。

    原文:  our new neighbor. Nigel is our new next-door neighbor. He is a pilot. He was in the R.A.F. He w ...

  3. Ioc原理理解

    IoC理论的背景 我们都知道,在采用面向对象方法设计的软件系统中,它的底层实现都是由N个对象组成的,所有的对象通过彼此的合作,最终实现系统的业务逻辑. 如果我们打开机械式手表的后盖,就会看到与上面类似 ...

  4. Element-UI 日期范围 date-picke

    实际项目应用案例: <el-form-item label="开始日期:" prop="StartDate"> <el-date-picker ...

  5. Linux-cut命令(22)

    cut剪切命令cut命令通常用来对某个文本文件进行解析,擅长处理以一个字符间隔的文本内容 -b :以字节(bytes)为单位进行分割.这些字节位置将忽略多字节字符边界,除非也指定了 -n 标志. -c ...

  6. 【Java每日一题】20170321

    20170320问题解析请点击今日问题下方的“[Java每日一题]20170321”查看(问题解析在公众号首发,公众号ID:weknow619) package Mar2017; public cla ...

  7. docker限制容器内存使用上限

    记录一个项目开发部署中遇到的一个问题,处理经验总结. 问题: 我们的项目使用的是Angular6 + Spring boot + redis + mycat结构,项目部署在容器里面,项目正式部署以后, ...

  8. 04-HTML-图片标签

    <html> <head>  <title>图片标签学习</title>  <meta charset="utf-8"/> ...

  9. 如何用JavaScript判断dom是否有存在某class的值?

    例如: <html class="no-js"> <head> </head> <body> </body> </ ...

  10. h5笔记02

    Markdown 用普通文本描述富文本的语法 扩展名md,markdown 链接:http://wowubuntu.com/markdown/ 代表h标签 没有符号的代表段落 -符号代表无序列表 1. ...