Android常用调试命令大全(下)

disable 某个app

adb shell pm disable pkn

disbale某个组件

adb shell pm disable com.google.android.setupwizard com.google.android.setupwizard.util.WebDialogActivity

查看所有的权限组

adb shell pm list permission-groups

查看当前连接设备

adb devices

fastboot devices(fastboot模式下)

进入bootloader模式刷机

adb reboot bootloader

./flash_all.sh

进入fastboot模式push image

adb reboot fastboot

adb flash super super.img

进入recovery模式

adb reboot recovery

adb查看log

查看所有log(级别大于Warning)

adb logcat -b all \*:W

查看event log

adb logcat -b events

查看system log

adb logcat -v time

查看main log

adb logcat -b main

抓取完整bugreport

adb bugreport

查看crash

adb logcat -b crash

查看android first api

adb shell getprop ro.product.first\_api\_level

查看设备上的输入法

adb shell ime list -s

Build.DEVICE

adb shell getprop ro.product.device

dipper

Build.VERSION.RELEASE

adb shell getprop ro.build.version.release

12

Build.MODEL

adb shell getprop ro.product.model

Build.VERSION.INCREMENTAL

adb shell getprop ro.build.version.incremental

版本号

Build.VERSION.SDK_INT

adb shell getprop ro.build.version.sdk

31

Build.TYPE

adb shell getprop ro.build.type

user

Build.TAGS

adb shell getprop ro.build.tags

test-keys

手机挂载

// 第一次执行如下两条

adb disable-verity

adb reboot

// 正常只需执行下面

adb root

adb remount

查看某个apk的详细信息

aapt dump badging apkName

查看ams内存信息

process+oom+category+total

adb shell dumpsys meminfo

输出指定包名的进程,可能包含多个进程

adb shell dumpsys meminfo --package

输出指定pid的某一进程

adb shell dumpsys meminfo

查看手机详细的内存信息

adb shell cat /proc/meminfo

查看cpu和内存占用情况

adb shell top

查看binder transaction信息

adb shell cat /sys/kernel/debug/binder/transaction\_log

查看上次anr信息

adb shell dumpsys activity lastanr

查看上次anr traces信息

adb shell dumpsys activity lastanr-traces

让设备进入idle状态

adb shell dumpsys battery unplug

adb shell dumpsys deviceidle step 执行四遍

查看Alarm相关信息

adb shell dumpsys alarm

查看电池信息

adb shell dumpsys battery

获取当前系统的亮度值

adb shell settings get system screen\_brightness

更改亮度值

adb shell settings put system screen\_brightness 150

查看对应的job

adb shell dumpsys jobscheduler pkg

触发job

adb shell cmd jobscheduler run -f pkgName jobId

查看sensor相关信息

adb shell dumpsys sensorservice

查看内核log

adb shell dmesg -w

抓取native进程traces

adb shell debuggerd -b pid

放开权限校验

adb shell setenforce 0

恢复权限校验

adb shell setenforce 1

编译该模块

make selinux\_policy -j4

截图

adb shell screencap -p /sdcard/screen.png

录屏(指定时间为10s)

adb shell screenrecord --time-limit 10 sdcard/record.mp4

最后

如果想要成为架构师或想突破20~30K薪资范畴,那就不要局限在编码,业务,要会选型、扩展,提升编程思维。此外,良好的职业规划也很重要,学习的习惯很重要,但是最重要的还是要能持之以恒,任何不能坚持落实的计划都是空谈。

如果你没有方向,这里给大家分享一套由阿里高级架构师编写的《Android八大模块进阶笔记》,帮大家将杂乱、零散、碎片化的知识进行体系化的整理,让大家系统而高效地掌握Android开发的各个知识点。
在这里插入图片描述
相对于我们平时看的碎片化内容,这份笔记的知识点更系统化,更容易理解和记忆,是严格按照知识体系编排的。

全套视频资料:

一、面试合集

在这里插入图片描述
二、源码解析合集
在这里插入图片描述

三、开源框架合集
在这里插入图片描述
欢迎大家一键三连支持,若需要文中资料,直接扫描文末CSDN官方认证微信卡片免费领取↓↓↓

猜你喜欢

转载自blog.csdn.net/weixin_43440181/article/details/130434817
今日推荐