码迷,mamicode.com
首页 > 其他好文 > 详细

monkey之monkeyServer

时间:2018-01-26 13:59:33      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:and   ali   art   rip   pos   androi   批处理   log   als   

 

基本命令:

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

标签:and   ali   art   rip   pos   androi   批处理   log   als   

原文地址:https://www.cnblogs.com/stin/p/8358825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!