adb 常用命令

adb 常用命令

  • adb 查看帮助文档

    adb --help
  • 启动adb服务

    adb start-server
  • 关闭adb服务

    adb kill-server
  • 获取设备号

    adb devices
  • 获取系统版本

    adb shell getprop ro.build.version.release
  • 查看手机运行日志

    adb logcat
  • 切换进手机终端

    adb shell
  • 获取app启动包名和启动名

    • Mac/Linux

      adb shell dumpsys window windows | grep mFocusedApp
    • 在Windows终端中运行

      adb shell dumpsys window windows | findstr mFocusedApp
  • 发送文件到手机

    adb push 电脑端?件路径/需要发送的文件,手机端存储的路径
    adb push 文件路径/sdcard
  • 从手机拉取文件

    adb pull 手机端的路径/拉取文件名 电脑端存储文件路径
    adb pull /sdcard/xx.png 文件路径
  • 安装APP

    adb install 路径/xxx.apk
  • 卸载APP

    # 1. 先使用adb shell dumpsys window windows | grep mFocusedApp 查看包名
    adb shell dumpsys window windows | grep mFocusedApp
    # 2. 根据查看到的包名卸载
    adb uninstall 包名

相关推荐