分享免费的编程资源和教程

网站首页 > 技术教程 正文

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

goqiw 2024-10-04 22:09:25 技术教程 29 ℃ 0 评论

一、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


10.查看屏幕分辨率:

adb shell wm size


11.修改屏幕密度:

adb shell wm density 240


三、logcat相关命令:

12. 打印带时间信息

adb logcat -v time>1.txt


13. 比如:通信Log打印:

adb logcat -b radio >1.txt

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


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

adb logcat -b all > 1.txt


五、其他工具命令:

15. 录屏:

adb shell screenrecord /sdcard/demo.mp4

adb pull /sdcard/demo.mp4


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

adb root

adb remount

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

adb push build.prop system/build.prop

adb shell

cd system/

chmod 644 build.prop

adb reboot


Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表