MonkeyRunner脚本录制与回放(一)

2018-01-03 11:55:16来源:CSDN作者:lfx_xianxian人点击

分享

录制与回放步骤:

1、安装好SDK,很简单,不说了。

2、将下面的内容拷贝存到文件中,起个名字然后放到自己想要存放的路径,例如w我自己存在了w盘:W:/monkeyrunner/monkey_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 mrfrom com.android.monkeyrunner.recorder import MonkeyRecorder as recorderdevice = mr.waitForConnection()recorder.start(device)

cmd命令输入命令:
monkeyrunner w:/monkeyrunner/monkey_recorder.py
这里写图片描述

微信扫一扫

第七城市微信公众平台