How to Restore Xiaomi with ADB Fastboot Tools: A Complete Guide with Teams

Xiaomi smartphones are known for their performance and flexibility, but even they are not immune to software failures. If your device hovers on the logo, does not turn on or gives a No Command error in Recovery mode, the ADB and Fastboot tools will be your salvation. These utilities allow you to interact with the device at a low level, bypassing standard MIUI interfaces.

Recovery through ADB/Fastboot requires care: one error in the team can turn a smartphone into a brick. However, with the right approach, you can unlock the bootloader, flash the stock firmware or even bring the device back to life after a failed update. In this article, we present current commands for 2026, working on models from Redmi Note 10 to Xiaomi 14 Ultra, as well as solutions to typical errors such as remote: oem unlock is not allowed.

What are ADB and Fastboot and why do they need Xiaomi?

ADB (Android Debug Bridge) is a bridge between a computer and a smartphone that works even when the screen of the device is not responding.

  • πŸ“ Install/remove system applications (adb install) app.apk)
  • πŸ”„ Reboot your device in Fastboot or Recovery (adb reboot bootloader)
  • πŸ“‹ Get system logs for diagnostics (adb logcat)
  • πŸ”§ Fixing errors like com.android.phone has stopped

Fastboot is a firmware mode that is activated before the operating system boots.

  • πŸ”“ Unlock the bootloader (fastboot oem unlock)
  • πŸ“± Custom or stock firmware ROM (fastboot flash system system.img)
  • πŸ”„ Partition Restore (Fastboot Flash Boot) boot.img)
  • πŸ› οΈ Invalid sparse file format at header

On Xiaomi, these tools are especially important because of the closed bootloader. Without unlocking through the Mi Unlock Tool, you can't flash custom software, and in some cases, even return the stock firmware. However, even with the bootloader blocked, ADB will help reset or copy important data.

⚠️ Attention: Using Fastboot on devices with a locked bootloader may cause Anti-Rollback protection to work. MIUI Redmi Note 12 will lock the device forever.

πŸ“Š What tool do you use most often to restore Xiaomi?
ADB
Fastboot
Mi Flash Tool
SP Flash Tool
No rebuilt.

Recovery Preparation: What You Need to Work with ADB/Fastboot

Before you start your recovery, make sure you have everything you need:

ComponentRequirementsWhere to find it.
ComputerWindows 10/11, macOS or Linux. USB 3.0+ portsβ€”
USB cableOriginal or certified (not cheap Chinese)A set of smartphones or Xiaomi store
ADB/Fastboot ToolsThe latest version (1.4.3+ for Windows)Official Android website
Drivers.For Xiaomi - Mi USB DriverXiaomi website
FirmwareStock Fastboot ROM for your modelXiaomi Firmware Updater

On Windows, there is often a problem when a device is identified as a Qualcomm HS-USB QDLoader 9008 instead of an Android Bootloader Interface.

  1. Open Device Manager (Win + X β†’ Device Manager).
  2. Find a device with a yellow exclamation mark.
  3. Update the driver manually by specifying the folder with the Mi USB Driver.

⚠️ Note: MacOS and Linux may require manual access rights settings USB-Without this, Fastboot will return the no permissions error.

β˜‘οΈ Preparation of the working environment

Done: 0 / 5

Unlocking the Xiaomi bootloader via Fastboot

Without an unlocked bootloader, you can’t flash custom software or even stock firmware through Fastboot. Xiaomi requires official unblocking confirmation through the Mi Account. The process takes up to 72 hours (on new models like Xiaomi 13T – up to 360 hours!).

Step-by-step:

  1. Link your Mi Account to your device in Settings β†’ Xiaomi Account β†’ Mi Cloud.
  2. Activate USB debugging in Settings β†’ About Phone β†’ MIUI version (tap 7 times), then go back to Settings β†’ Additional β†’ For Developers.
  3. Connect your smartphone to your PC and execute: adb reboot bootloader
  4. Launch the Mi Unlock Tool (download from the official website) and log in to your account.
  5. If you see a Couldn't unlock error, wait until the specified time (usually 168 hours for new devices).

Once successfully unlocked, the bootloader will be labeled Unlocked, and you can flash the device. Some models (such as the POCO F5) reset all data after unlocking!

What if the Mi Unlock Tool can’t see the device?
1. Check that the drivers are installed correctly (should show "Android Bootloader Interface"). 2. USB-port (preferably) USB 2.0. 3. Disable driver signatures in Windows (click on) F8 loading β†’ "Disable mandatory driver signature verification.4) 4. Use the original Xiaomi cable (cheap cables often don’t support data transfer to Fastboot).

Xiaomi Recovery via Fastboot: Stock ROM Firmware

If the smartphone is not turned on or stuck on the logo, stock firmware via Fastboot is the most reliable way to recover. This will require a Fastboot ROM for your model (file with the extension.tgz or.zip).

Instructions:

  1. Unpack the archive with the firmware in a folder with Fastboot Tools.
  2. Put the device in Fastboot: adb reboot bootloader or pinch Power + Volβˆ’ off-phone.
  3. Run the firmware command: fastboot flash all Or for new devices (with super section): fastboot update rom.zip
  4. Wait until it's finished (10-20 minutes). Don't turn off the cable.

If the process is interrupted with a FAILED error (remote: 'Partition not found'), then you have downloaded the firmware not for your model.

fastboot getvar product
Mistake.Reason.Decision
remote: 'Flashing is not allowed in Lock State'bootloader lockedUnlock with the Mi Unlock Tool
FAILED (remote: 'Invalid sparse file format at header')Firmware file damagedDownload the archive again, check the MD5 checksum
waiting for any devicePC doesn't see the deviceCheck drivers, cable, USB port

fastboot flash boot boot.img

fastboot flash system system.img

fastboot flash vendor vendor.img

This will help you avoid errors with sections.-->

Error Fixing with ADB: When Fastboot Doesn't Help

If the device is powered on but is not running smoothly (e.g., constantly restarting or issuing a Setup Wizard has stopped error), ADB can help without completely flashing.

  • πŸ”„ Cache reset (helps with lags): adb reboot recovery (in recovery, select Wipe) β†’ Wipe Cache)
  • πŸ“± Removal of the problem application: adb shell pm uninstall --user 0 com.example.app
  • πŸ”§ Restoration of access rights (if lost after the root): adb shell su -c 'chmod 644 /system/etc/hosts'
  • πŸ“‹ Getting error logs: adb logcat > error_log.txt

If the smartphone is getting stuck on the No Command screen in Recovery mode, try:

  1. Press the Power + Vol+ for 10 seconds.
  2. Connect via ADB and run adb sideload update.zip (where update.zip is the update file for your model).

⚠️ Attention: Adb shell rm command -rf /data delete all user data without recovery! Use only if you are ready for a full reset.

πŸ’‘

If Xiaomi does not respond to ADB commands, but is defined in Device Manager as Qualcomm HS-USB Diagnostics 900E, then the device is in EDL mode. To restore, you will need an authorized Xiaomi account and specialized software like Mi Flash Pro.

Recovery after a failed update or custom firmware

If after firmware custom ROM (for example, LineageOS or Pixel Experience) the smartphone stopped turning on, the reasons may be as follows:

  • πŸ”΄ Incompatibility with the version of the bootloader (Anti-Rollback).
  • πŸ”΄ Damage to the boot or dtbo section.
  • πŸ”΄ Absence of a vendor file in custom ROM.

Decisions:

  1. Return the stock. boot.img: fastboot flash boot stock_boot.img (The file can be extracted from the official firmware).
  2. Swipe the stock MIUI through Fastboot (see section above).
  3. Use OrangeFox Recovery to recover the backup, if you have one.

On models with a Qualcomm processor (for example, Redmi Note 11 Pro+), the EDL (Emergency Download Mode) mode will help with the "brick".

  1. Turn off your smartphone.
  2. Press Vol++ Volβˆ’ and connect the USB cable.
  3. The device will be defined as QHSUSB_BULK or 9008.
  4. Use the Mi Flash Tool with the clean all and lock option for full flashing.
How to log into EDL on MediaTek?
On devices with a MediaTek chipset (such as the POCO M4 Pro), you need to close the test points on the motherboard to log into the EDL, and it's a risky operation to contact a service center.

Frequent mistakes and their solutions

Even experienced users face problems when recovering from ADB/Fastboot, and here are the most common errors and ways to fix them:

Mistake.Probable causeDecision
device not foundADB does not see the deviceCheck it out. USB-Reboot ADB-server: adb kill-server adb start-server
remote: 'Flashing is not allowed in Lock State'bootloader lockedUnlock the device through the Mi Unlock Tool (see section above)
FAILED (remote: 'unknown command')Unsupported team for this modelCheck the command syntax for your device (for example, on Xiaomi 12, fastboot flashing unlock is used instead of fastboot oem unlock)
invalid sparse file format at header magicThe.img file in the firmware is damagedDownload the firmware again, check MD5. Or convert sparse to raw via simg2img.
This miui version cannot be downgradedIt's the Anti-Rollback.Sweeve only the newer version of MIUI or return to stock via the Mi Flash Tool with the clean all option

If you see a remote error: 'Partition table doesn't exist', it means that the partition table is corrupted. EDL file-based prog_emmc_firehose.mbn for your model.

FAQ: Answers to Frequent Questions

Can Xiaomi be restored without unlocking the bootloader?
Yes, but the possibilities will be limited. ADB You can: Reset the settings (adb shell recovery) --wipe_data). Remove problematic applications. Copy important data (adb pull) /sdcard/DCIM). However, it will not work to flash stock or custom firmware through Fastboot - you need an unlocked bootloader.
How do I know if my Xiaomi bootloader is unlocked?
Turn off the device, then press Power + Volβˆ’ to enter the Fastboot. If you see Unlocked at the bottom of the screen and a yellow unlock icon, the bootloader is unlocked. If there is no label or there is a lock icon, it is locked.
What if Xiaomi does not turn on and flashes a red indicator after the firmware?
The red indicator signals a critical boot error. Try: Swipe stock firmware through Fastboot (see section above). If it doesn't work, use EDL mode (requires an authorized Xiaomi account). Check the battery: sometimes flashing is caused by low charge (plug in charge for 30 minutes).
Can I recover data after a Fastboot reset?
No. Commands like fastboot erase userdata or firmware through clean all in the Mi Flash Tool permanently delete data from the /data partition. If you don't backup through TWRP or ADB, you can't recover files.
Why does Mi Unlock Tool show "Couldn't unlock"?
Causes and solutions: πŸ”Ή Mi Account is not linked to the device β†’ Put it in the settings and wait 7 days. πŸ”Ή New device (released less than 30 days ago) β†’ Wait 360 hours (15 days). πŸ”Ή Use of non-original cable β†’ Try out the original Xiaomi cable. πŸ”Ή Drivers not installed β†’ Set up Mi. USB Driver manually.