@ECHO OFF
title XDJA-Monkey
::获取手机信息
adb shell cat /system/build.prop>phone.info
FOR /F "tokens=1,2 delims==" %%a in (phone.info) do (
IF %%a == ro.build.version.release SET androidOS=%%b
IF %%a == ro.product.model SET model=%%b
IF %%a == ro.build.fota.version SET Rom_version=%%b
)
del /a/f/q phone.info
ECHO ---------------------------------------------------------
ECHO 手机型号: %model%
ECHO 系统版本: Android %androidOS%
ECHO ROM 版本: %Rom_version%
ECHO ---------------------------------------------------------
::设置手机各项参数
adb shell settings put system screen_brightness_mode 0
ECHO 关闭屏幕自动调节亮度...
adb shell settings put system screen_brightness 0
ECHO 屏幕亮度设置为0...
adb shell settings put global auto_time 1
ECHO 时间设置为网络获取...
adb shell settings put system screen_off_timeout 1800000
ECHO 设置屏幕休眠为30min...
ECHO ---------------------------------------------------------
adb shell am start -n com.app.UserLog/com.app.UserLog.UserLogSetting
ECHO ---------------------------------------------------------
::============各模块包命名==============
set "app1=-p com.android.contacts"
set "app2=-p com.android.mms"
set "app3=-p org.codeaurora.snapcam"
set "app4=-p com.android.gallery3d"
set "app5=-p com.android.settings"
set "app6=-p com.android.calendar"
set "app7=-p com.lqsoft.launcher3"
set "app8=-p com.android.browser"
set "app9=-p com.android.deskclock"
set "appA=-p com.android.calculator2"
set "appB=-p com.caf.fmradio"
set "appC=-p com.android.soundrecorder"
set "appD=-p com.android.email"
set "appE=-p com.xdja.fileexplorer"
set "appF=-p com.xdja.notes"
set "appG=-p com.android.documentsui"
set "appH=-p cn.wps.moffice_eng"
set "appI=-p com.xdja.actoma"
set "appJ=-p com.xdja.HDSafeEMailClient"
set "appK=-p com.xdja.txassistant"
set "appL=-p com.xdja.june.safebrowser"
::==============================================
ECHO.[模块列表]
ECHO 1.联系人 2.短信 3.相机 4.图库 5.设置
ECHO 6.日历 7.桌面 8.浏览器 9.时钟
ECHO A.计算器 B.FM C.录音 D.邮件 E.文件管理器
ECHO F.便签 G.下载 H.WPS I.安通+ G.安全邮件
ECHO K.通讯助手 L.安全浏览器
ECHO ---------------------------------------------------------
:selectmodel
set choice1=0
set choice2=0
set selmodel= 0
ECHO [全模块:all] [单模块:only] [组合模块:zh]
set /p selmodel= 选择测试方式:
::echo %selmodel%
::组合模块
IF %selmodel% == zh (
set /p choice1= 选择模块1:
set /p choice2= 选择模块2:
goto RunMonkey
)
::全模块
IF %selmodel% == all (
goto RunMonkey
)
::单模块
IF %selmodel% == only (
set /p choice2=选择待测模块:
goto RunMonkey
)
goto selectmodel
:RunMonkey
::变量延迟的启动
SetLocal EnableDelayedExpansion
ECHO ---------------------------------------------------------
ECHO monkey !app%choice1%! !app%choice2%! --throttle 500 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -v -v -v 180000
ECHO.
adb shell "monkey !app%choice1%! !app%choice2%! --throttle 500 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -v -v -v 180000 > /storage/sdcard0/monkey_log.txt &"
pause
Monkey测试批处理
最新推荐文章于 2022-01-01 16:10:31 发布