常用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 關閉權限檢測,當底層添加節點沒有權限或者提示權限不允許的時候輸入這個命令


發佈了49 篇原創文章 · 獲贊 13 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章