monkey之monkeyServer

Posted Claire_xu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了monkey之monkeyServer相关的知识,希望对你有一定的参考价值。

 

基本命令:

adb shell monkey --port 1080 &

adb forward tcp:1080 tcp:1080

telnet 127.0.0.1 1080

启动android端的monkey server,然后将端口转发到pc端,就可以在pc端

通过telnet连接monkey server

 

monkeyServerRun.vbs(测试脚本)

set sh=WScript.CreateObject("WScript.Shell")

WScript.Sleep 1000

sh.SendKeys "open 127.0.0.1 1080 {ENTER}"

WScript.Sleep 1000

sh.SendKeys "press KEYCODE_3 {ENTER}"

WScript.Sleep 1000

sh.SendKeys "press KEYCODE_7 {ENTER}"

WScript.Sleep 1000

sh.SendKeys "press KEYCODE_NUMPAD_ADD {ENTER}"

WScript.Sleep 1000

sh.SendKeys "press KEYCODE_2 {ENTER}"

WScript.Sleep 1000

sh.SendKeys "press KEYCODE_1 {ENTER}"

WScript.Sleep 1000

sh.SendKeys "press KEYCODE_NUMPAD_EQUALS {ENTER}"

WScript.Sleep 1000

sh.SendKeys "done {ENTER}"

WScript.Sleep 1000

使用monkey服务端测试应用时时,需事先连上手机端,打开应用

monkeySever.bat(批处理脚本)

adb forward tcp:1080 tcp:1080

adb shell am start -n com.android.calculator2/com.android.calculator2.Calculator

start telnet.exe

cscript //nologo .\monkeyServerRun.vbs

以上是关于monkey之monkeyServer的主要内容,如果未能解决你的问题,请参考以下文章

monkey之monkey简介

adb命令之monkey压力测试篇

monkey之monkey命令详解

玩转Android monkey之monkey小实战

android之monkey测试

软件测试之Monkey 初步了解(入门级)