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.
Recovery Preparation: What You Need to Work with ADB/Fastboot
Before you start your recovery, make sure you have everything you need:
| Component | Requirements | Where to find it. |
|---|---|---|
| Computer | Windows 10/11, macOS or Linux. USB 3.0+ ports | β |
| USB cable | Original or certified (not cheap Chinese) | A set of smartphones or Xiaomi store |
| ADB/Fastboot Tools | The latest version (1.4.3+ for Windows) | Official Android website |
| Drivers. | For Xiaomi - Mi USB Driver | Xiaomi website |
| Firmware | Stock Fastboot ROM for your model | Xiaomi 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.
- Open Device Manager (Win + X β Device Manager).
- Find a device with a yellow exclamation mark.
- 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
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:
- Link your Mi Account to your device in Settings β Xiaomi Account β Mi Cloud.
- Activate USB debugging in Settings β About Phone β MIUI version (tap 7 times), then go back to Settings β Additional β For Developers.
- Connect your smartphone to your PC and execute: adb reboot bootloader
- Launch the Mi Unlock Tool (download from the official website) and log in to your account.
- 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?
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:
- Unpack the archive with the firmware in a folder with Fastboot Tools.
- Put the device in Fastboot: adb reboot bootloader or pinch Power + Volβ off-phone.
- Run the firmware command: fastboot flash all Or for new devices (with super section): fastboot update rom.zip
- 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 locked | Unlock with the Mi Unlock Tool |
| FAILED (remote: 'Invalid sparse file format at header') | Firmware file damaged | Download the archive again, check the MD5 checksum |
| waiting for any device | PC doesn't see the device | Check 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:
- Press the Power + Vol+ for 10 seconds.
- 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:
- Return the stock. boot.img: fastboot flash boot stock_boot.img (The file can be extracted from the official firmware).
- Swipe the stock MIUI through Fastboot (see section above).
- 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".
- Turn off your smartphone.
- Press Vol++ Volβ and connect the USB cable.
- The device will be defined as QHSUSB_BULK or 9008.
- Use the Mi Flash Tool with the clean all and lock option for full flashing.
How to log into EDL on MediaTek?
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 cause | Decision |
|---|---|---|
| device not found | ADB does not see the device | Check it out. USB-Reboot ADB-server: adb kill-server adb start-server |
| remote: 'Flashing is not allowed in Lock State' | bootloader locked | Unlock the device through the Mi Unlock Tool (see section above) |
| FAILED (remote: 'unknown command') | Unsupported team for this model | Check 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 magic | The.img file in the firmware is damaged | Download the firmware again, check MD5. Or convert sparse to raw via simg2img. |
| This miui version cannot be downgraded | It'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.