> ## 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.

# Switch to EDL mode using ADB

<Note>
  `adbd` is disabled on the device by default and must be explicitly enabled before use.
</Note>

## Introduction

Describes an alternative procedure to switch devices into
EDL mode using ADB. This procedure is only applicable if the device has
a preloaded image.

At a high level, the workflow includes the following:

* Set up the host system with required tools (QUD, ADB)
* Connect device to ADB
* Switch device to EDL mode

## Install required packages

QUD is required to ensure the host system can properly detect and
communicate with the Qualcomm device over USB in Emergency Download
(EDL) mode.

* Clone the `qud` GitHub repository:
  ```bash theme={null}
  git clone https://github.com/quic/quic-usb-drivers.git
  ```

* Ensure the install script is executable:
  ```bash theme={null}
  chmod +x quic-usb-drivers/QcDevDriver.sh
  ```

* Install the QUD driver:
  ```bash theme={null}
  sudo ./quic-usb-drivers/QcDevDriver.sh install
  ```

ADB is used to communicate with a running device and is required to trigger a reboot
into EDL mode from the operating system. It provides a convenient way to transition
the device into the correct state for flashing without manual intervention.

* Install `adb` on your host system using the system package manager:
  ```bash theme={null}
  sudo apt install android-tools-adb android-tools-fastboot
  ```

* Verify if `adb` is installed on your system:

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

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

* The `adbd` service is disabled by default. A one-time setup is required to
  enable the service before `adb` can be used.

  * Connect to the device by following the
    [Connect via UART](/Key-Documents/Flash-Guide/boot-up#connect-via-uart) guide.

  * Create the file `/etc/usb-debugging-enabled` to enable `adbd`.

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

  * Configure the `adbd` service to start automatically.

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

## Connect to ADB

* Connect the device using the USB Type-C cable to the host computer.

* Ensure that the device is recognized as a device by `adb`:

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

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

* Connect to an `adb` shell:
  ```bash theme={null}
  adb shell
  ```

## Switch device to EDL mode

* In the `adb` shell, switch the device to EDL mode:
  ```bash theme={null}
  reboot edl
  ```

* Verify if the device is in EDL mode:

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

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