adb
服務(wù)進(jìn)程啟動(dòng)
adb start-server
adb
服務(wù)進(jìn)程停止
adb kill-server
查看連接的設(shè)備
adb devices
安裝APP
adb install $path/$文件名稱(chēng).apk
//ex:
adb install apk/baidu.apk
- $path: 文件路徑
卸載APP
卸載apk
adb uninstall <package> //ex: adb install com.baidu.search
卸載apk火俄,保留數(shù)據(jù)和緩存文件
adb uninstall -k <package> // ex: adb uninstall -k com.baidu.search
查看log
adb logcat
adb logcat -d>crash.log
adb logcat -t '10-18 19:00:00.000'>crash.log
-d
到當(dāng)前時(shí)間自動(dòng)暫停
-t
獲取設(shè)置時(shí)間點(diǎn)之后的日志伙菊,含-d
搜索crash 堆椃恚可以嘗試使用以下關(guān)鍵字:
--------- beginning of crash
***
fatal
backtrace
每個(gè)都嘗試下巍耗,一般都可以搜到
傳文件到手機(jī)
adb push local_file_path /sdcard
local_file_path本地文件路徑
從手機(jī)拉取文件
adb pull file_path local_folder_path
file_path: 文件在手機(jī)中的路徑兜看,一般是/sdcard/XXX
local_folder_path: 文件拉取到本地存儲(chǔ)的目錄⊥骰瑁可以不指定绪氛,不指定就拉取到當(dāng)前所在目錄
退出adb shell
exit
查看輸入法列表
# adb shell ime list -s
com.android.inputmethod.latin/.LatinIME
com.sohu.inputmethod.sogouoem/.SogouIME
adb截屏
adb shell screencap /sdcard/0.png
adb pull /sdcard/0.png D:\test
adb錄屏
adb shell screenrecord /sdcard/demo.mp4
adb pull /sdcard/demo.mp4 D:\test\
獲取手機(jī)分辨率
adb shell wm size
獲取手機(jī)屏幕密度
adb shell wm density
獲取手機(jī)的arm架構(gòu)
adb shell getprop ro.product.cpu.abi
arm64-v8a: 64位
armeabi-v7a:32位
輸入法
獲取輸入法列表
adb shell ime list -s
切換輸入法
adb shell ime set com.sohu.inputmethod.sogou/.SogouIME
adb shell ime set com.android.inputmethod.latin/.LatinIME
查看手機(jī)內(nèi)存情況
adb shell
cat /proc/meminfo
查看手機(jī)存儲(chǔ)信息
獲取手機(jī)存儲(chǔ)信息
adb shell df
獲取手機(jī)內(nèi)部存儲(chǔ)信息:
魅族手機(jī):
adb shell df /mnt/shell/emulated
其他:
adb shell df /data
獲取sdcard存儲(chǔ)信息:
adb shell df /storage/sdcard
獲取前臺(tái)的Activity
adb shell dumpsys activity top | grep ACTIVITY
獲取系統(tǒng)版本
adb獲取android手機(jī)系統(tǒng)版本脑慧,已對(duì)應(yīng)的api版本和硬件相關(guān)信息
獲取手機(jī)系統(tǒng)api版本
adb shell getprop ro.build.version.sdk
獲取手機(jī)系統(tǒng)版本
adb shell getprop ro.build.version.release
anr 堆棧如何獲取
adb bugreport
生成的zip文件解壓縮惠窄,打開(kāi)FS>data>anr中可以看到anr堆棧文件