> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 ADB 切换到 EDL 模式

<Note>
  设备上默认禁用 `adbd`，使用前必须显式启用。
</Note>

## 简介

介绍使用 ADB 将设备切换到 EDL 模式的替代流程。此流程仅适用于设备已预装镜像的情况。

从整体上看，该工作流程包括以下内容：

* 在主机系统上安装所需工具（QUD、ADB）
* 将设备连接到 ADB
* 将设备切换到 EDL 模式

## 安装所需软件包

需要 QUD 来确保主机系统能够正确检测处于紧急下载
(EDL) 模式的 Qualcomm 设备，并通过 USB 与其
通信。

* 克隆 `qud` GitHub 仓库：
  ```bash theme={null}
  git clone https://github.com/quic/quic-usb-drivers.git
  ```

* 确保安装脚本可执行：
  ```bash theme={null}
  chmod +x quic-usb-drivers/QcDevDriver.sh
  ```

* 安装 QUD 驱动：
  ```bash theme={null}
  sudo ./quic-usb-drivers/QcDevDriver.sh install
  ```

ADB 用于与正在运行的设备通信，并且是从操作系统触发
重启进入 EDL 模式所必需的。它提供了一种便捷的方式，
无需手动干预即可将设备切换到适合刷写的状态。

* 使用系统包管理器在主机系统上安装 `adb`：
  ```bash theme={null}
  sudo apt install android-tools-adb android-tools-fastboot
  ```

* 验证系统上是否已安装 `adb`：

  ```bash theme={null}
  adb --version
  ```

  ```text Sample output theme={null}
  Android Debug Bridge version 1.0.39
  Version 1:8.1.0+r23-5ubuntu2
  ```

* `adbd` 服务默认处于禁用状态。在使用 `adb` 之前，需要进行
  一次性设置以启用该服务。

  * 按照[通过 UART 连接](/zh/Key-Documents/Flash-Guide/boot-up#connect-via-uart)指南
    连接到设备。

  * 创建文件 `/etc/usb-debugging-enabled` 以启用 `adbd`。

    ```bash theme={null}
    touch /etc/usb-debugging-enabled
    ```

  * 将 `adbd` 服务配置为自动启动。

  ```bash theme={null}
  systemctl enable --now android-tools-adbd
  ```

## 连接到 ADB

* 使用 USB Type-C 数据线将设备连接到主机。

* 确保设备已被 `adb` 识别：

  ```bash theme={null}
  adb devices
  ```

  ```text Sample output theme={null}
  List of devices attached
  68f592a device
  ```

* 连接到 `adb` shell：
  ```bash theme={null}
  adb shell
  ```

## 将设备切换到 EDL 模式

* 在 `adb` shell 中，将设备切换到 EDL 模式：
  ```bash theme={null}
  reboot edl
  ```

* 验证设备是否处于 EDL 模式：

  ```bash theme={null}
  lsusb
  ```

  ```text Sample output theme={null}
  Bus 002 Device 014: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)
  ```
