• 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

  • 相关阅读:
    android自定义通知栏遇到的问题
    写博客号的初衷
    模型转换遇关键字
    界面传值的四种方式
    button循环添加事件
    解析数据的步骤
    数组排序 (数组是有序容器,因此集合中只有数组才能排序。)
    集合遍历
    自定义view和自定义cell
    cell自适应高度
  • 原文地址:https://www.cnblogs.com/yudx/p/11215075.html
Copyright © 2020-2023  润新知