adb 常用工具

2018-06-30  本文已影响0人  百花鱼藤

1、APP:分配内存的大小

adb shell getprop | grep dalvik.vm.heapsize  

2、 APP内存使用情况

adb shell dumpsys meminfo 包名  

3、获取内存快照

adb shell am dumpheap com.android.browser /data/local/tmp/test.hprof
adb pull /data/local/tmp/test.hprof  path : 领取到本地 
hprof-conv e:\test.hprof e:\test1.hprof

4、开启关闭profile

adb shell am profile start  包名  /mnt/sdcard/profile
adb shell am  profile stop 包名
adb pull /mnt/sdcard/profile e:\test
traceview e:\test

5、重置、收集电量数据

adb shell dumpsys batterystats --enable full-wake-histor
adb shell dumpsys batterystats --reset

6、获取电量报告
adb bugreport > bugreport.txt
adb shell dumpsys batterystats > com.example.android.sunshine.app > batterystats.txt
将txt文档转化为html文件,命令如下:
python historian.py -a bugreport.txt > battery.html

上一篇 下一篇

猜你喜欢

热点阅读