adb重連
- adb kill-server
- adb start-server
日志抓取
1、adb logcat>1.log
2、adb bugreport
3、adb shell dumpsys dropbox --print >>1.log
pull/push文件
adb pull ./sdcard/cxx.trace
adb push xxx ./sdcard
獲取應用版本名/版本號
adb shell dumpsys package com.baidu.haokan | grep versionName
adb shell dumpsys package com.baidu.haokan | grep versionCode
adb shell screenrecord --bugreport /sdcard/launch.mp4 錄制屏幕
adb pull /sdcard/launch.mp4
adb shell pm list package
17.截屏并保存至 sdcard 目錄:
adb shell screencap -p /sdcard/screen.png
18.錄制視頻并保存至sdcard:adb shell screenrecord sdcard/record.mp4,執(zhí)行命令后操作手機,ctrl + c 結束錄制,錄制結果保存至 sdcard:
adb shell screenrecord sdcard/record.mp4
19.獲取設備分辨率:adb shell wm size
adb shell wm size
20.列出指定應用的 dump 信息:adb shell pm dump 包名
adb shell pm dump
21.列出對應包名的 .apk 位置:adb shell pm path 包名
adb shell pm path
22.查看當前終端中的進程信息:adb shell ps
adb shell ps
23.monkey測試:adb shell monkey –p 程序包 –v 測試次數(shù) ,比如“adb shell monkey –p com.htc.Weather –v 20000”意思是對com.htc.Weather 這個程序包單獨進行一次20000次的monkey測試
adb shell monkey –p 程序包 –v 測試次數(shù)
24.顯示所有程序包:
adb shell ps | grep [process]
25.根據(jù)進程pid或包名查看進程占用的內存
adb shell dumpsys meminfo
adb shell dumpsys meminfo<package_name>
26.Android 代碼設置調試等待
adb shell am set-debug-app -w --persistent packagename
–persistent 持久,如果沒有這個選項,就只有一次調試等待。如果有,以后每次啟動app 都會有。
如果想要清楚,就adb shell am clear-debug-app
27停止運行APP
adb shell am force-stop com.xiaomi.micolauncher