標籤:proc 報告 重新命名檔案 chm uil add address wifi密碼 pre
ADB很強大,記住一些ADB命令有助於提高工作效率。
擷取序號:
adb get-serialno
查看串連電腦的裝置:
adb devices
重啟機器:
adb reboot
重啟到bootloader,即刷機模式:
adb reboot bootloader
重啟到recovery,即復原模式:
adb reboot recovery
查看log:
adb logcat
終止adb服務進程:
adb kill-server
重啟adb服務進程:
adb start-server
擷取機器MAC地址:
adb shell cat /sys/class/net/wlan0/address
擷取CPU序號:
adb shell cat /proc/cpuinfo
安裝APK:
adb install <<span style="padding: 0px; margin: 0px; line-height: 21px;">apkfile> //比如:adb install baidu.apk
保留資料和快取檔案,重新安裝apk:
adb install -r <<span style="padding: 0px; margin: 0px; line-height: 21px;">apkfile> //比如:adb install -r baidu.apk
安裝apk到sd卡:
adb install -s <<span style="padding: 0px; margin: 0px; line-height: 21px;">apkfile> // 比如:adb install -s baidu.apk
卸載APK:
adb uninstall <<span style="padding: 0px; margin: 0px; line-height: 21px;">package> //比如:adb uninstall com.baidu.search
卸載app但保留資料和快取檔案:
adb uninstall -k <<span style="padding: 0px; margin: 0px; line-height: 21px;">package> //比如:adb uninstall -k com.baidu.search
啟動應用:
adb shell am start -n <<span style="padding: 0px; margin: 0px; line-height: 21px;">package_name>/.<<span style="padding: 0px; margin: 0px; line-height: 21px;">activity_class_name>
查看裝置cpu和記憶體佔用情況:
adb shell top
查看佔用記憶體前6的app:
adb shell top -m 6
重新整理一次記憶體資訊,然後返回:
adb shell top -n 1
查詢各進程記憶體使用量情況:
adb shell procrank
殺死一個進程:
adb shell kill [pid]
查看進程列表:
adb shell ps
查看指定進程狀態:
adb shell ps -x [PID]
查看後台services資訊:
adb shell service list
查看當前記憶體佔用:
adb shell cat /proc/meminfo
查看IO記憶體分區:
adb shell cat /proc/iomem
將system分區重新掛載為可讀寫分區:
adb remount
從本地複製檔案到裝置:
adb push <<span style="padding: 0px; margin: 0px; line-height: 21px;">local> <<span style="padding: 0px; margin: 0px; line-height: 21px;">remote>
從裝置複製檔案到本地:
adb pull <<span style="padding: 0px; margin: 0px; line-height: 21px;">remote> <<span style="padding: 0px; margin: 0px; line-height: 21px;">local>
列出目錄下的檔案和檔案夾,等同於dos中的dir命令:
adb shell ls
進入檔案夾,等同於dos中的cd 命令:
adb shell cd <<span style="padding: 0px; margin: 0px; line-height: 21px;">folder>
重新命名檔案:
adb shell rename path/oldfilename path/newfilename
刪除system/avi.apk:
adb shell rm /system/avi.apk
刪除檔案夾及其下面所有檔案:
adb shell rm -r <<span style="padding: 0px; margin: 0px; line-height: 21px;">folder>
移動檔案:
adb shell mv path/file newpath/file
設定檔案許可權:
adb shell chmod 777 /system/fonts/DroidSansFallback.ttf
建立檔案夾:
adb shell mkdir path/foldelname
查看檔案內容:
adb shell cat <<span style="padding: 0px; margin: 0px; line-height: 21px;">file>
查看wifi密碼:
adb shell cat /data/misc/wifi/*.conf
清除log緩衝:
adb logcat -c
查看bug報告:
adb bugreport
擷取裝置名稱:
adb shell cat /system/build.prop
查看ADB協助:
adb help
跑monkey:
adb shell monkey -v -p your.package.name 500
轉】Android ADB命令大全