stressapptest Android代码位置 alps\external\stressapptest
将stressapptest push到system/bin目录下:
./stressapptest -s 86400 -m 4 -i 4 -c 4 -C 4 -M xxx
It is to stress test memory copy, invert, crc check for 1hour with 900Mb memory.
-s: number of second to run the application 测试时间
-m: number of memory copy threads to run 复制线程数 (Memory Copy)
-i: number of memory invert threads to run 反转线程数 (Invert Copy)
-c: CRC check CRC校验 (Data Check)
-C: number of memory CPU stress threads to run CPU压力线程数
-M: Megabytes of ram to run 尽可能测试最大的可用存储空间,(设置超过了memfree,就会被kill)
批量测试:
@echo off
set testTimeInsecond=1800
set mbytes=400
set threads=8
@echo off
echo CONNECTED....
:NOCONNECTED
@echo off
setlocal enabledelayedexpansion
set devices=
for /f "tokens=1,3,5,7,9,11,13,15,17 skip=1" %%t in ('adb devices') do (
set "devices=!devices! %%t"
)
echo devices
for %%d in (%devices%) DO adb -s %%d root
for %%d in (%devices%) DO start adb -s %%d shell stressapptest -s %testTimeInSecond% -M %mbytes% -m %threads% -W -l /sdcard/memtest.log
pause