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.
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:
- Download Android SDK Platform-Tools (the official package from Google, including adb.exe and fastboot.exe).
- Unpack the archive to the root of the disk C:\platform-tools\ (pathless!).
- 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 system | Driver/Package | Team to check |
|---|---|---|
| Windows 10/11 | Mi Flash Tool + Platform-Tools | Adb devices (must show serial number) |
| Linux (Ubuntu/Debian) | sudo apt install adb fastboot | lsusb | grep Xiaomi (connection check) |
| macOS | brew install android-platform-tools | system_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.mipicksImportant: 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 #RestoreOn 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:
- Link your Mi Account to your device in Settings β Xiaomi Account β Mi Cloud.
- Get permission to unlock through the official Xiaomi website (can take up to 72 hours).
- Download the Mi Unlock Tool and run it on behalf of the administrator.
- Turn your phone into Fastboot mode: turn off β pinch Power + Volume Down.
- 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"
| Xiaomi model | Features of unlocking |
|---|---|
| Redmi Note 10/11/12 | Requires the latest version of the Mi Unlock Tool (older versions don't see the device). |
| POCO F3/F4/F5 | You may need to disable Mi Protection in your account settings. |
| Mi 11/12/13 | Anti-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.
- Download the firmware for your model from the official website (choose the version of Fastboot).
- Unpack the archive in a folder without Cyrillic (for example, C:\miui_fastboot\).
- Start the Mi Flash Tool, select the folder with the firmware.
- Connect your phone in Fastboot mode and press Refresh.
- 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):
- Unlock the bootloader (see the previous section).
- Install TWRP via Fastboot: fastboot flash recovery twrp.img fastboot boot twrp.img
- In TWRP, make Wipe β Format Data (required!).
- 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 device | Drivers not installed or USB-debugging unactivated. | Check adb devices in another folder or reinstall drivers. |
| fastboot: error: Failed to boot into fastbootd | Incompatible 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 unauthorized | Unconfirmed. 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:
- Press the Power + Volume Up for 10-15 seconds (forced reboot).
- Fastboot: fastboot flash recovery recovery.img fastboot boot recovery.img
- 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.