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开发知识
在这里插入图片描述

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