[android]android性能测试命令行篇
2023-09-14 08:56:50 时间
adb shell top — Returns the CPU info for all the Process IDs (PID)
adb shell dumpsys meminfo PID — Returns the memory info for the particular Process ID
adb shell procrank — Returns the PSS, RSS, VSS and USS for all the process IDs (PID)
adb shell cat /proc/cpuinfo — Returns the processor information of the emulator
adb shell cat /proc/meminfo — Returns the memory Info for all the process IDs (PID)
adb logcat — Returns the log messages, including GC
我将会用这些命令做出一些东西,形成内存曲线图提供给测试协助判断内存泄露问题。
Android has an interesting command called dumpsys to dump some system information. Even described on adb manual I think that some points should be reinforced. In order to get the complete status just run (will produce a large output):
adb shell dumpsys
Also you can apply filters to running services:
1 SurfaceFlinger
2 accessibility
3 account
4 activity
5 alarm
6 appwidget
7 audio
8 backup
9 battery
10 batteryinfo
11 bluetooth
12 bluetooth_a2dp
13 clipboard
14 connectivity
15 content
16 cpuinfo
17 device_policy
18 devicestoragemonitor
19 diskstats
20 dropbox
21 entropy
22 ethernet
23 hardware
24 input_method
25 iphonesubinfo
26 isms
27 keybar
28 location
29 media.audio_flinger
30 media.audio_policy
31 media.camera
32 media.player
33 meminfo
34 mount
35 netstat
36 network_management
37 notification
38 package
39 permission
40 phone
41 power
42 search
43 sensorservice
44 simphonebook
45 statusbar
46 telephony.registry
47 throttle
48 uimode
49 usagestats
50 vibrator
51 wallpaper
52 wifi
53 window
Some examples:
adb shell dumpsys wifi
adb shell dumpsys cpuinfo
I suggest you try other items on the list above and be creative using all the power of Unix pipes. Example, to get all memory allocated by each process you can do something like:
adb shell dumpsys meminfo | grep "allocated:" | awk {total = total + $5}END{print total}
工具倒是蛮好做的,各位大牛,你们觉得我1分钟记录一次相关数据最后形成曲线图,在此期间该APP一直在做monkey测试,是否对测试有意义呢?
adb shell dumpsys meminfo PID — Returns the memory info for the particular Process ID
adb shell procrank — Returns the PSS, RSS, VSS and USS for all the process IDs (PID)
adb shell cat /proc/cpuinfo — Returns the processor information of the emulator
adb shell cat /proc/meminfo — Returns the memory Info for all the process IDs (PID)
adb logcat — Returns the log messages, including GC
我将会用这些命令做出一些东西,形成内存曲线图提供给测试协助判断内存泄露问题。
Android has an interesting command called dumpsys to dump some system information. Even described on adb manual I think that some points should be reinforced. In order to get the complete status just run (will produce a large output):
adb shell dumpsys
Also you can apply filters to running services:
1 SurfaceFlinger
2 accessibility
3 account
4 activity
5 alarm
6 appwidget
7 audio
8 backup
9 battery
10 batteryinfo
11 bluetooth
12 bluetooth_a2dp
13 clipboard
14 connectivity
15 content
16 cpuinfo
17 device_policy
18 devicestoragemonitor
19 diskstats
20 dropbox
21 entropy
22 ethernet
23 hardware
24 input_method
25 iphonesubinfo
26 isms
27 keybar
28 location
29 media.audio_flinger
30 media.audio_policy
31 media.camera
32 media.player
33 meminfo
34 mount
35 netstat
36 network_management
37 notification
38 package
39 permission
40 phone
41 power
42 search
43 sensorservice
44 simphonebook
45 statusbar
46 telephony.registry
47 throttle
48 uimode
49 usagestats
50 vibrator
51 wallpaper
52 wifi
53 window
Some examples:
adb shell dumpsys wifi
adb shell dumpsys cpuinfo
I suggest you try other items on the list above and be creative using all the power of Unix pipes. Example, to get all memory allocated by each process you can do something like:
adb shell dumpsys meminfo | grep "allocated:" | awk {total = total + $5}END{print total}
工具倒是蛮好做的,各位大牛,你们觉得我1分钟记录一次相关数据最后形成曲线图,在此期间该APP一直在做monkey测试,是否对测试有意义呢?
相关文章
- 代码加密 android,Android 开发怎样做代码加密或混淆「建议收藏」
- android开发笔记之 Android代码混淆打包
- strictmode android,Android中的StrictMode
- 读书 Android应用开发揭秘[通俗易懂]
- android sdk根目录,Android SDK位置
- android declare-styleable 和style,Android 关于declare-styleable属性的写法….
- robotium android,Robotium 测试Android apk安装包
- android触摸屏事件,Android Touch事件分析
- android的toast提示_android studio unknown host
- android线程间通信的几种方法_Android进程间和线程间通信方式
- 【Android】JNI静态与动态注册介绍
- Android 中的长度单位详解
- 【Android 应用开发】Android应用的自动更新模块
- 【ijkplayer】编译 Android 版本的 ijkplayer ⑥ ( 进入 ijkplayer-android/android 目录 | 执行 compile-ijk.sh 脚本完成编译 )
- 【Android Gradle 插件】将自定义 Gradle 插件上传到自建 Maven 仓库 ② ( java 和 groovy 插件自带文档任务 | 自定义文档打包任务 | 生成文档包 )
- Android Studio 导入项目 出现安装Error:Cause: failed to find target with hash string ‘android-23’ 等错误详解手机开发
- 基于Android设计模式之--SDK源码之策略模式的详解
- Android入门之画图详解
- Android实现将已发送的短信写入短信数据库的方法