adb 命令大全

本文详细介绍了Android设备管理工具ADB的各类命令,包括连接设备、安装应用、数据传输、设备控制等多个方面,是开发者调试Android应用不可或缺的参考资料。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值