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测试,是否对测试有意义呢?

更多相关文章

  1. Android(安卓)Junit 单元测试步骤
  2. Android(安卓)AGPS 定位 测试程序
  3. [zz] Android(安卓)上的 Native C
  4. Android(安卓)CTS 总结
  5. Android(安卓)之 ProgressDialog用法介绍
  6. Android(安卓)之 ProgressDialog用法介绍
  7. Android(安卓)自动化测试工具Robotium 之Solo类的详细说明
  8. android折叠展开列表动态修改显示测试
  9. Android:BT测试代码

随机推荐

  1. android 胡言乱语 1 android basic
  2. Android(安卓)在TextView 中显示图片的4
  3. 学习Android之-----------------------An
  4. Android Lint & Checkstyle
  5. Android 启动栈管理方式 (二)
  6. Kotlin语言概述2
  7. 【Android】Android apk默认安装位置设置
  8. android:textAppearance是什么意思
  9. Android图片太大导致无法正常显示
  10. Android(安卓)NDK学习(2)Windows下NDK开发