adb常用命令总结(持续更新)

本文汇总了多种Android设备的调试技巧,包括ADB命令的应用、系统分区操作、文件夹复制、bootimage编译、SELinux错误日志查看、Monkey测试命令、应用权限及进程管理等关键调试方法。

1、默认打开应用权限

adb shell dumpsys activity appops on

2、对system分区进行操作

adb root
adb disable-verity
adb reboot
adb root
adb remount

3、复制文件夹到指定目录

src_files := $(shell ls $(LOCAL_PATH)/source/app )
PRODUCT_COPY_FILES += $(foreach file, $(src_files), \$(LOCAL_PATH)/source/app/$(file):system/app/$(file))

4、编bootimage

make bootimage -B -j24

5、查看SELinux权限错误log

adb shell
logcat | grep 'avc:'

6、Monkey命令(全模块)

adb shell "monkey --ignore-crashes --ignore-timeouts --throttle 500 --ignore-security-exceptions --monitor-native-crashes --ignore-native-crashes 10000 > sdcard/monkey.txt"

adb shell monkey --ignore-crashes --ignore-timeouts --ignore-security-exceptions --monitor-native-crashes --ignore-native-crashes --throttle 500  -v -v -v 999999999

7、Monkey命令(单模块)

adb shell monkey -p com.android.contacts --ignore-crashes --ignore-timeouts --ignore-security-exceptions --monitor-native-crashes --ignore-native-crashes --throttle 500 -v 10000 > sdcard/monkey.txt"

8、获取包名所在路径

adb shell pm path {package}


9、获取手机中的三方包名

adb shell pm list packages -3

10、强行停止monkey
adb shell 
ps | grep monkey
kill monkey对应pid

11、列出所有可以dump的选项

adb shell dumpsys -l

12、定位一个包属于哪个应用

adb shell pm path (包名)

13、冷冻GMS

*#*#741#*#*

14、查看当前正在运行的程序

dumpsys activity | grep "Running activities" -A 7

15、查看内存信息

adb shell dumpsys meminfo > meminfo.txt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值