常用adb命令行

adb root 赋予root权限

adb remount  赋予可push/删除等操作文件权限

adb shell am start com.android.settings/.Settings  --adb命令跳转设置apk

adb shell am start com.android.launcher3/.Launcher   --adb命令跳转桌面apk

adb shell am start com.mediatek.mtklogger/.MainActivity 拉起mtklog测试apk

adb shell am start com.mediatek.mco/.MainActivity mtk多核观测器

adb shell am start -n com.mediatek.engineermode/.EngineerMode 工程模式

adb shell am start com.android.soundrecorder/.SoundRecorder 系统录音

adb shell /system/bin/screencap -p storage/emulated/0/screenshot.png 截图保存到SDCard

adb pull storage/emulated/0/screenshot.png C:\Users\thinkpad\Desktop\screenshot.png   d:/screenshot.png 后面是电脑路径

adb shell dumpsys activity top |more 点击回车显示下一行
adb shell dumpsys activity top > C:\Users\thinkpad\Desktop\1.txt路径  获取Android手机当前界面Activity包名,类名
adb shell input keyevent 3  home 执行home键
adb shell input keyevent 4  back 执行返回键
adb shell input keyevent 26 触摸唤醒

adb shell getprop 查看prop的属性值

adb shell setprop +键+值 setprop  audio.offload.min.duration.secs  22

adb shell top -m 10 查看cpu占用排行10的 

adb shell getevent dev/input/event1

adb disable-verity 如果是MTK的userdebug版本第一次adb root remount无效时执行此命令,然后重启下即可remount了

adb shell chmod -R 644 system/build.prop 每次push一次之后,需要运行此命令 否则会开机开不了

chmod -R 777 xxx  开权限  如果是adb环境,则需要adb shell  su,7=4+2+1

adb logcat -s xiaozheng  输出指定标签内容(如自己的tag标记"TAG",且区分大小写的)
adb logcat -c 清除已存在的日志信息
adb logcat -b main > C:\Users\thinkpad\Desktop\main_log.txt  将log文件实时的保存在xxx.txt文件里面,按ctrl+c退出保存,不然会一直往里面保存log信息
adb shell cat /proc/kmsg > C:\Users\thinkpad\Desktop\kernellog.txt  导出kernellog需要root remount
adb shell dumpsys package> C:\Users\thinkpad\Desktop\dumpsys_package.txt  

=========================

进入adb shell

logcat -d -b events | grep "boot" android启动时间

df 查看文件容量大小(adb shell里面)

cat /proc/kmsg 查看avc错误

cat /proc/bootprof 开机时间分析

setenforce 0 关闭权限检测,当底层添加节点没有权限或者提示权限不允许的时候输入这个命令


猜你喜欢

转载自blog.csdn.net/u010672559/article/details/79960063