Android adb 命令大全


描述

命令

1、查詢已連接設備/模擬器

adb devices

2、指定設備獲取屏幕分辨率

adb -s 設備號 shell wm size

3、給指定設備安裝應用

adb -s 設備號 install test.apk

4、啟動 adb server 命令

adb start-server

5、停止 adb server 命令

adb kill-server

6、查看adb版本

adb version

7、指定 adb server 的網絡端口

adb -P <port> start-server

8、通過 IP 地址連接設備

adb connect <device-ip-address>

9、斷開無線連接

adb disconnect <device-ip-address>

10、查看所有應用

adb shell pm list packages

11、查看系統應用

adb shell pm list packages -s

12、查看第三方應用

adb shell pm list packages -3

13、卸載應用(<packagename> 表示應用的包名,-k 參數可選,表示卸載應用但保留數據和緩存目錄。)

adb uninstall [-k] <packagename>

14、清除應用數據與緩存

adb shell pm clear <packagename>

15、復制設備里的文件到電腦

adb pull <設備里的文件路徑> [電腦上的目錄]

16、復制電腦里的文件到設備

adb push <電腦上的文件路徑> <設備里的目錄>

17、電源鍵

adb shell input keyevent 26

18、菜單鍵

adb shell input keyevent 82

19、HOME 鍵

adb shell input keyevent 3

20、返回鍵

adb shell input keyevent 4

21、增加音量

adb shell input keyevent 24

22、降低音量

adb shell input keyevent 25

23、靜音

adb shell input keyevent 164

24、播放/暫停

adb shell input keyevent 85

25、停止播放

adb shell input keyevent 86

26、播放下一首

adb shell input keyevent 87

27、播放上一首

adb shell input keyevent 88

28、恢復播放

adb shell input keyevent 126

29、暫停播放

adb shell input keyevent 127

30、滑動解鎖(參數 300 1000 300 500 分別表示起始點x坐標 起始點y坐標 結束點x坐標 結束點y坐標。)

adb shell input swipe 300 1000 300 500

31、輸入文本

adb shell input text hello

32、清空日志

adb logcat -c

33、查看設備型號

adb shell getprop ro.product.model

34、電池狀況

adb shell dumpsys battery

35、屏幕分辨率

adb shell wm size

36、屏幕密度

adb shell wm density

37、顯示屏參數

adb shell dumpsys window displays

38、查看Android 系統版本

adb shell getprop ro.build.version.release

39、查看IP 地址

adb shell ifconfig | grep Mask

40、Mac 地址

adb shell cat /sys/class/net/wlan0/address

41、CPU 信息

adb shell cat /proc/cpuinfo

42、內存信息

adb shell cat /proc/meminfo

43、使用 Monkey 進行壓力測試(表示向 <packagename> 指定的應用程序發送 500 個偽隨機事件。)

adb shell monkey -p <packagename> -v 500

44、查看進程

adb shell ps

45、查看實時資源占用情況

adb shell top

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM