Android開發必須知道的adb命令大全

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 start-server
8、通過 IP 地址連接設備 adb connect
9、斷開無線連接 adb disconnect
10、查看所有應用 adb shell pm list packages
11、查看系統應用 adb shell pm list packages -s
12、查看第三方應用 adb shell pm list packages -3
13、卸載應用( 表示應用的包名,-k 參數可選,表示卸載應用但保留數據和緩存目錄。) adb uninstall [-k]
14、清除應用數據與緩存 adb shell pm clear
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
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 進行壓力測試(表示向 指定的應用程序發送 500 個僞隨機事件。) adb shell monkey -p -v 500
44、查看進程 adb shell ps
45、查看實時資源佔用情況 adb shell top

關注我,瞭解更多Android開發知識
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章