美文网首页
adb 常用工具

adb 常用工具

作者: 百花鱼藤 | 来源:发表于2018-06-30 11:51 被阅读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

相关文章

网友评论

      本文标题:adb 常用工具

      本文链接:https://www.haomeiwen.com/subject/ipvayftx.html