ADB and Fastboot Tools for Xiaomi: How to use without errors

ADB (Android Debug Bridge) and Fastboot are powerful tools that allow you to control Xiaomi smartphones at the system level, which can unlock the bootloader, install custom firmware, restore the device after a crash, or even get root rights, but the wrong use of these tools can β€œbrick” the phone β€” turning it into a useless β€œbrick”.

In this article, we will discuss the unique features of working with ADB/Fastboot on Xiaomi devices (including Redmi models, POCO and Mi), as they have specific limitations: the blocked bootloader by default, the requirement to link the Mi Account and the features of interaction with the user. MIUI. You will learn how to prepare a PC, what commands to use for different tasks, and how to avoid typical errors that lead to data loss or device breakdown.

What are ADB and Fastboot and why Xiaomi owners need them

ADB (Android Debug Bridge is a tool for debugging Android devices through USB It allows you to execute commands on your smartphone directly from your computer, install/delete applications, copy files, and even change system settings. ADB possible:

  • πŸ“± Remove embedded applications MIUI (Bloatware that cannot be uninstalled in standard ways.
  • πŸ”„ Restore access to the device if the pattern lock or password is forgotten.
  • πŸ“¦ Install APK-files on devices without Google Play (for example, on Xiaomi for the Chinese market).
  • πŸ” Get system logs for error diagnosis.

Fastboot is a protocol for working with a device at the bootloader level. Unlike ADB, which runs on Android, Fastboot is activated when the phone is turned off + the volume button is clamped down.

  • πŸ”“ Unlock the bootloader on Xiaomi.
  • πŸ“² Switch official or custom images (fastboot flash).
  • πŸ› οΈ Restore the device after unsuccessful updates.
  • πŸ”„ Change the recovery section to TWRP or.

⚠️ Note: On Xiaomi devices with MIUI 12 and later unlocking the bootloader via Fastboot requires you to link the Mi Account to the device.

Xiaomi’s main difference from other brands is the closed bootloader by default, which means that without prior unlocking, you can’t flash custom recovery or alternative firmware. Moreover, some models (such as the POCO F5 or Redmi Note 12 Pro+) have additional Anti-Rollback protection, which blocks the firmware of older versions of MIUI.

πŸ“Š What are you using for? ADB/Fastboot Xiaomi?
Unlocking the loader
Installation of custom firmware
Removal of embedded applications
Recovery after failure
Other

Preparation of the PC and smartphone Xiaomi to work with ADB/Fastboot

Before you start a team, you have to adjust the environment, and without the right training, even a simple adb device command won't work.

Installation of drivers and platform

Windows requires:

  1. Download Android SDK Platform-Tools (the official package from Google, including adb.exe and fastboot.exe).
  2. Unpack the archive to the root of the disk C:\platform-tools\ (pathless!).
  3. Install drivers for Xiaomi: πŸ–₯️ For Windows. 10/11: Download the Mi Flash Tool - the drivers are included. 🐧 For Linux/macOS: sufficient rights to execute chmod files +x adb fastboot.

2. Setup of Xiaomi smartphone

The device must:

β˜‘οΈ Xiaomi Preparation for ADB/FastbootInsert "Developer mode" (7 taps MIUI")Activate "Debugging by" USB" In the developer settings Connect the device to the PC and confirm the trusted computer Allow "Unlock" OEM" (for Fastboot)Open "Mi Protection" in account settings: 0 / 5

Feature Xiaomi: after activation of debugging USB It may need to be rebooted to get drivers to pick up correctly, also on some models (e.g. Redmi). K50) need to be added USB-Debugging (security options) in the developer menu.

Operating systemDriver/PackageTeam to check
Windows 10/11Mi Flash Tool + Platform-ToolsAdb devices (must show serial number)
Linux (Ubuntu/Debian)sudo apt install adb fastbootlsusb | grep Xiaomi (connection check)
macOSbrew install android-platform-toolssystem_profiler SPUSBDataType | grep Xiaomi

⚠️ Attention: On Xiaomi with MIUI 14 When you first connect to a PC, you may be asked to unlock Mi Unlock Status. If you ignore it, the Fastboot teams will not work.

The main ADB teams for Xiaomi: from simple to complex

ADB allows you to perform actions that are not available through the standard MIUI interface. Below are the commands that will be useful to Xiaomi owners most often.

Basic diagnostic commands

adb devices # Show connected devices


adb shell getprop ro.product.model # Learn the Xiaomi model




adb shell pm list packages # List of all installed applications




adb shell dumpsys battery # Battery information (level, temperature)

2. Work with applications

Remove embedded applications (such as Mi Browser or GetApps):

adb shell pm uninstall --user 0 com.android.browser


adb shell pm uninstall --user 0 com.xiaomi.mipicks

Important: some system applications (e.g., com.miui.securitycenter) cannot be removed, which will lead to system failure.

3. Backup and restoration

adb backup -apk -obb -shared -all -f backup.ab # Full backup


adb restore backup.ab #Restore

On Xiaomi, the backup via ADB may not include data from some applications (e.g. Mi Home or Mi Fit) due to MIUI limitations.

πŸ’‘If the adb device command does not show the device, try switching the connection mode. USB to β€œTransfer of files" (MTP) notice-curtain.

Unlock the bootloader on Xiaomi via Fastboot

Unlocking the bootloader is a must for custom recovery or alternative firmware, and Xiaomi has its own nuances:

  1. Link your Mi Account to your device in Settings β†’ Xiaomi Account β†’ Mi Cloud.
  2. Get permission to unlock through the official Xiaomi website (can take up to 72 hours).
  3. Download the Mi Unlock Tool and run it on behalf of the administrator.
  4. Turn your phone into Fastboot mode: turn off β†’ pinch Power + Volume Down.
  5. Connect to your PC and in Mi Unlock Tool, press Unlock.

Once unlocked, the device will automatically reset to factory settings. All data will be deleted!

What to do if the Mi Unlock Tool shows "Couldn't unlock"
Most likely, it has not been 72 hours since the account was attached. Also check: - Internet connection on PC (tool checks the status of unlocking online). - Mi Unlock Tool version (for new models you need the latest version). - No custom recovery (if previously TWRP was put, return stock recovery via Fastboot: fastboot flash recovery.img).

Xiaomi modelFeatures of unlocking
Redmi Note 10/11/12Requires the latest version of the Mi Unlock Tool (older versions don't see the device).
POCO F3/F4/F5You may need to disable Mi Protection in your account settings.
Mi 11/12/13Anti-Rollback protection: You can't flash old versions of MIUI.

Xiaomi firmware through Fastboot: official and custom images

Fastboot allows you to flash both official MIUI images (via the Mi Flash Tool) and custom firmware (for example, LineageOS or Pixel Experience).

  • πŸ”’ Official firmware can be flashed only on an unlocked bootloader.
  • πŸ“¦ The scaling needs installation TWRP or other recovery.
  • ⚠️ On models with anti-Rollback (for example, Redmi) K40) You can’t go back to the old versions. MIUI.

The official MIUI is installed via the Mi Flash Tool.

  1. Download the firmware for your model from the official website (choose the version of Fastboot).
  2. Unpack the archive in a folder without Cyrillic (for example, C:\miui_fastboot\).
  3. Start the Mi Flash Tool, select the folder with the firmware.
  4. Connect your phone in Fastboot mode and press Refresh.
  5. Choose the firmware method: Clean all – complete cleaning (recommended in case of failures); Clean all and lock – cleaning + locking the bootloader (for sale of the device); Save user data – data storage (not always stable).

Press Flash and wait until it is completed (5-10 minutes).

πŸ’‘Xiaomi with MediaTek processor (e.g. Redmi Note 11 or POCO M4 Pro) Fastboot requires an additional auth file (comprised with firmware) without which the Mi Flash Tool will give an error.

Installation of custom firmware

For custom firmware (such as LineageOS or ArrowOS):

  1. Unlock the bootloader (see the previous section).
  2. Install TWRP via Fastboot: fastboot flash recovery twrp.img fastboot boot twrp.img
  3. In TWRP, make Wipe β†’ Format Data (required!).
  4. Copy ZIP firmware on your phone and install it via Install.

⚠️ Note: On Xiaomi with dynamic partitions (e.g. Mi) 11 Ultra or Redmi K50 Pro) standard TWRP It doesn't work. We need a special version that supports it. dynamic_partitions.

Common mistakes when working with ADB/Fastboot Xiaomi and their solutions

Even experienced users experience errors when working with Xiaomi, and here are the most common ways to fix them:

Mistake.Reason.Decision
waiting for deviceDrivers not installed or USB-debugging unactivated.Check adb devices in another folder or reinstall drivers.
fastboot: error: Failed to boot into fastbootdIncompatible version of Fastboot or blocked bootloader.Update Platform-Tools or unlock bootloader.
Mi Flash: "Flash Done. Unlock Fail"It was 72 hours after the Mi Account was linked.Wait 3 days or use informal methods (risky).
adb: device unauthorizedUnconfirmed. RSA-key.Disable/connect USB and confirm a trusted computer on the Xiaomi screen.

If the phone does not turn on after firmware or hung on the MI logo, try:

  1. Press the Power + Volume Up for 10-15 seconds (forced reboot).
  2. Fastboot: fastboot flash recovery recovery.img fastboot boot recovery.img
  3. Run Wipe Data in a sewage recovery.

How to avoid Xiaomi becoming a brick

Incorrect actions with ADB/Fastboot can lead to a hard brick, a state where the device does not respond to any commands.

  • πŸ”‹ Always check the battery power (minimum 50% before firmware).
  • πŸ“‹ Check the instructions for a particular model (for example, the firmware for the Redmi Note 10 Pro will not work for the Redmi Note 10).
  • πŸ”’ Do not flash files from unknown sources (risk of catching a virus or incompatible image).
  • πŸ“‘ Use the original. USB-cable (cheap cables can interrupt data transmission).

If the device has already "bricked":

  • πŸ”Œ Try to connect to the PC in mode EDL (9008) (close the test points on the board or use a jig).
  • πŸ› οΈ To restore the EDL You need an authorized Xiaomi account (or paid services like Mi Account Bypass).
  • πŸ“¦ If the phone is warranty, contact the service center (self-repair cancels the warranty).

πŸ’‘On Xiaomi with Qualcomm processor (most flagships) mode EDL You can activate the adb reboot edl command, but only if the device is still powered on.

FAQ: Frequent questions about ADB and Fastboot on Xiaomi

Can I unlock a bootloader on Xiaomi without waiting 72 hours?
Xiaomi blocks unlock for 3 days to protect against theft, but there are informal methods through exploits (for example, for older models on MIUI 11), but they are risky and can lead to a ban on the Mi Account.
How to flash Xiaomi if the Mi Flash Tool can’t see the device?
The problem may be: Outdated version of the Mi Flash Tool (download the latest from the official website); lack of Qualcomm HS-USB QDLoader 9008 drivers (need for EDL mode); Incorrect connection mode (should be Fastboot, not Recovery); Try also to run Mi Flash Tool on behalf of the administrator.
Can I return the official firmware after the custom?
Yes, but: On models with Anti-Rollback (such as the Mi 10T or POCO X3 Pro), you can't flash a version of MIUI older than the current one. If you were using custom recovery (TWRP), return the stock one first via Fastboot. Use the Mi Flash Tool with the Clean all option to avoid conflicts.
Why doesn’t ADB see my Xiaomi device on macOS/Linux?
Unix systems often require: Add a rule for udev (Linux): echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2717", MODE="0666"' | sudo tee /etc/udev/rules.d/51-android.rules sudo udevadm control --reload-rules Reconnect the device: Make sure adb and fastboot are eligible to execute (chmod) +x).
How to reset the pattern lock to Xiaomi via ADB?
If you forget your password: Connect your phone to a PC with the switch on USB-Debugging (if activated previously) Command: Adb shell su rm /data/system/gesture.key rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm reboot After reboot, the password will be reset. ⚠️ It only works if root has been previously received or debugging enabled!