adb shell 命令_Android性能优化

android adb 个不得不会的命令,你掌握了么?记得收藏

一、dumpsys相关命令:

1. 查看当前Top的Activity:

adb shell dumpsys window|grep Foc


2. 查看屏幕信息:

adb shell dumpsys window displays


3. dumsys activity相关信息:

adb shell dumpsys activity activities


4. 查看service是否alive?

adb shell dumpsys activity services |grep ***Service --服务名称


5. 打印应用所有权限信息:

adb shell dumpsys package com.android.launcher3 >launcher_001.txt


二、am pm wm 等命令

6. 直接启动activity:

adb shell am start -n com.android.launcher3/com.android.launcher3.launcher


7. kill应用进程:

adb shell am force-stop com.android.launcher3


8. 测算应用启动性能数据

adb shell am start -W 包名/xxxActivity


9. 清除应用缓存:

adb shell pm clear com.android.launcher3


.查看屏幕分辨率:

adb shell wm size


.修改屏幕密度:

adb shell wm density


三、logcat相关命令:

. 打印带时间信息

adb logcat -v time>1.txt


. 比如:通信Log打印:

adb logcat -b radio >1.txt

adb logcat -b main -b radio -v time>log.txt


. 打印所有系统模块日志(
main/event/system/kernel/radio):

adb logcat -b all > 1.txt


五、其他工具命令:

. 录屏:

adb shell screenrecord /sdcard/demo.mp4

adb pull /sdcard/demo.mp4


. 手动替换 build.prop(系统属性文件)

adb root

adb remount

adb pull system/build.prop 并手动修改对应文件

adb push build.prop system/build.prop

adb shell

cd system/

chmod build.prop

adb reboot


原文链接:,转发请注明来源!