轉】Android ADB命令大全

來源:互聯網
上載者:User

標籤:proc   報告   重新命名檔案   chm   uil   add   address   wifi密碼   pre   

ADB很強大,記住一些ADB命令有助於提高工作效率。

  1. 擷取序號:

    adb get-serialno
  2. 查看串連電腦的裝置:

    adb devices
  3. 重啟機器:

    adb reboot
  4. 重啟到bootloader,即刷機模式:

    adb reboot bootloader
  5. 重啟到recovery,即復原模式:

    adb reboot recovery
  6. 查看log:

    adb logcat
  7. 終止adb服務進程:

    adb kill-server
  8. 重啟adb服務進程:

    adb start-server
  9. 擷取機器MAC地址:

    adb shell cat /sys/class/net/wlan0/address
  10. 擷取CPU序號:

    adb shell cat /proc/cpuinfo
  11. 安裝APK:

    adb install <<span style="padding: 0px; margin: 0px; line-height: 21px;">apkfile> //比如:adb install baidu.apk
  12. 保留資料和快取檔案,重新安裝apk:

    adb install -r <<span style="padding: 0px; margin: 0px; line-height: 21px;">apkfile> //比如:adb install -r baidu.apk
  13. 安裝apk到sd卡:

    adb install -s <<span style="padding: 0px; margin: 0px; line-height: 21px;">apkfile> // 比如:adb install -s baidu.apk
  14. 卸載APK:

    adb uninstall <<span style="padding: 0px; margin: 0px; line-height: 21px;">package> //比如:adb uninstall com.baidu.search
  15. 卸載app但保留資料和快取檔案:

    adb uninstall -k <<span style="padding: 0px; margin: 0px; line-height: 21px;">package> //比如:adb uninstall -k com.baidu.search
  16. 啟動應用:

    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>
  17. 查看裝置cpu和記憶體佔用情況:

    adb shell top
  18. 查看佔用記憶體前6的app:

    adb shell top -m 6
  19. 重新整理一次記憶體資訊,然後返回:

    adb shell top -n 1
  20. 查詢各進程記憶體使用量情況:

    adb shell procrank
  21. 殺死一個進程:

    adb shell kill [pid]
  22. 查看進程列表:

    adb shell ps
  23. 查看指定進程狀態:

    adb shell ps -x [PID]
  24. 查看後台services資訊:

    adb shell service list
  25. 查看當前記憶體佔用:

    adb shell cat /proc/meminfo
  26. 查看IO記憶體分區:

    adb shell cat /proc/iomem
  27. 將system分區重新掛載為可讀寫分區:

    adb remount
  28. 從本地複製檔案到裝置:

    adb push <<span style="padding: 0px; margin: 0px; line-height: 21px;">local> <<span style="padding: 0px; margin: 0px; line-height: 21px;">remote>
  29. 從裝置複製檔案到本地:

    adb pull <<span style="padding: 0px; margin: 0px; line-height: 21px;">remote> <<span style="padding: 0px; margin: 0px; line-height: 21px;">local>
  30. 列出目錄下的檔案和檔案夾,等同於dos中的dir命令:

    adb shell ls
  31. 進入檔案夾,等同於dos中的cd 命令:

    adb shell cd <<span style="padding: 0px; margin: 0px; line-height: 21px;">folder>
  32. 重新命名檔案:

    adb shell rename path/oldfilename path/newfilename
  33. 刪除system/avi.apk:

    adb shell rm /system/avi.apk
  34. 刪除檔案夾及其下面所有檔案:

    adb shell rm -r <<span style="padding: 0px; margin: 0px; line-height: 21px;">folder>
  35. 移動檔案:

    adb shell mv path/file newpath/file
  36. 設定檔案許可權:

    adb shell chmod 777 /system/fonts/DroidSansFallback.ttf
  37. 建立檔案夾:

    adb shell mkdir path/foldelname
  38. 查看檔案內容:

    adb shell cat <<span style="padding: 0px; margin: 0px; line-height: 21px;">file>
  39. 查看wifi密碼:

    adb shell cat /data/misc/wifi/*.conf
  40. 清除log緩衝:

    adb logcat -c
  41. 查看bug報告:

    adb bugreport
  42. 擷取裝置名稱:

    adb shell cat /system/build.prop
  43. 查看ADB協助:

    adb help
  44. 跑monkey:

    adb shell monkey -v -p your.package.name 500

轉】Android ADB命令大全

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.