Installing firmware or custom software via USB on Xiaomi smartphones is a process that requires pre-prepared devices. Many users experience errors like MiUnlock can't verify device or fastboot: unknown command precisely because they miss key stages of setting up, and this guide will help you figure out how to properly activate the installation mode via USB without typical problems.
The procedure includes not only the physical connection of the cable, but also software training: unlocking the loader, enabling debugging by USB, driver-mounting ADB/Fastboot. Without these steps, the system will not see the connected device, especially for Redmi Note models. 12, POCO X5 Other modern devices with Mi Account protection.
If you plan to install custom recavators (such as TWRP) or alternative firmware (LineageOS, Pixel Experience), you can not do without an unlocked bootloader. the manufacturer limits this feature by default, so the first step is the official unlock through the Mi Unlock Tool.
Important: the procedure will reset all data on the device! We recommend backing up in advance through Settings β Google β Backup or Mi Cloud.
1. Preparation of Xiaomi smartphone for installation via USB
Before you connect to a PC, you have to configure the device itself, and without that, the computer won't be able to recognize the phone in Fastboot or ADB mode.
First, activate the developer mode:
- Go to Settings. β The phone.
- Tap 7 times on the MIUI version until you become a developer!
- Return to the main settings menu β there will be a new section for developers.
Now turn on USB debugging and OEM unlocking:
- π§ Go to Settings. β For developers.
- π Activate the debugging switch on USB (A warning will appear β confirm the action).
- π Find the Unlocking item OEM Enable it (you may need to enter a password).
- π± In some models (Xiaomi 13, Redmi) K60) This item is hidden - use the search by settings.
β οΈ Attention: On devices with MIUI 14+ unlock OEM It may not be available with a linked Mi Account. Untie your account in Settings β Accounts. β Mi Account β Delete the account.
Developer mode activated | USB |OEM unlocked |Device untied from Mi Account (if required) |Data backup-->
2. Install ADB and Fastboot drivers on PC
Without the right drivers, Windows (or other OS) will not be able to recognize a smartphone in ADB or Fastboot modes. Official drivers from Xiaomi often become outdated, so it is better to use universal solutions.
Download and install:
- π₯οΈ Android SDK Platform-Tools (official package from Google with adb and fastboot).
- π Google Drivers USB Driver (part of Android Studio or downloaded separately).
- π οΈ For Windows: Mi Phone Manager (installing proprietary Xiaomi drivers).
After installation, check the connection:
- Connect your phone to your PC with a cable (preferably original).
- Open the Command Prompt in the folder with the platform-tools.
- Enter the command: adb devices If the device is displayed - the drivers are installed correctly.
β οΈ Warning: Windows 11 may block the installation of unsigned drivers. β Update and security β Recovery β Special download options and select Disable Mandatory Driver Signature Verification.
Windows 10|Windows 11|macOS|Linux|Another.-->
3 Unlock the bootloader through the Mi Unlock Tool
Without an unlocked bootloader, installing firmware via USB is not possible - a key security requirement for Xiaomi.The procedure takes up to 72 hours due to account verification.
Steps to unlock:
- Download the Mi Unlock Tool (official tool).
- Sign in to the app under the same Mi Account as on your phone.
- Transfer the phone to Fastboot: adb reboot bootloader or turn off the device and press Volume Down + Power.
- Connect your phone to your PC and press Unlock in the Mi Unlock Tool.
Typical errors and decisions:
| Mistake. | Reason. | Decision |
|---|---|---|
| Couldn't unlock | It has not been 72 hours since the account was linked. | Wait for the time and try again. |
| Device not connected | Wrong drivers or cable | Reinstall drivers, use the original cable |
| Mi Account not bound | The account is not tied to the device | Go to Settings. β Mi Account and log in |
| Network error | Internet connection problems | Disable VPN/proxy, check the connection |
What if the Mi Unlock Tool canβt see the device?
4. Install firmware through Fastboot
After unlocking the bootloader, you can start installing the firmware. This will require an official Fastboot-ROM for your model (you can download it on the official Xiaomi website).
Installation instructions:
- Unpack the downloaded archive with firmware in the platform-tools folder.
- Transfer your phone to Fastboot (as described above).
- Launch the file. flash_all.bat (for Windows or flash_all.sh (for Linux/macOS).
- Wait until the process is completed (usually 5-10 minutes).
For custom recavator (TWRP):
fastboot flash recovery twrp.img
fastboot boot twrp.imgβ οΈ Note: Newer models (Xiaomi 14, Redmi Note 13) may require you to disable firmware authentication. For this, do it before firmware: fastboot oem edl But it is risky - it may turn the device into a "brick".
π‘
If the firmware is interrupted by 99% with an anti-rollback error>, So you're trying to install an older version. MIUI, Upgrade to the last official firmware before downgrade.
5. Installation via ADB Sideload (for updates and custom software)
Regime. ADB Sideload allows you to install ZIP-Firmware or mod files directly through Recovery, which is useful if the standard Fastboot is not suitable.
Procedure:
- Download the right one. ZIP-file (e.g., Magisk for root or GApps).
- Transfer your phone to Recovery Mode: adb reboot recovery or press Volume up + Power when the device is off.
- From the recovery menu, select Apply update β Apply from ADB.
- On PC, execute the command: adb sideload name file.zip
Advantages of the method:
- π Suitable for devices with a locked bootloader (if there is root).
- π¦ Allows you to install modified firmware without full flashing.
- π‘οΈ Less risk of βbrickingβ compared to Fastboot.
π‘
ADB Sideload is the only way to install Magisk on locked bootloaders without unlocking, but requires a customized Recovery (TWRP or OrangeFox).
6. Solving common errors
Even with the right instructions, there can be problems, and here are the most common ways to solve them:
Fastboot: Error: Failed to boot into fastbootd
- π Check the cable β use the original from Xiaomi.
- π Reboot your phone in Fastboot manually (buttons).
- π₯οΈ Update platform-tools to the latest version.
Error: Adb: device unauthorized
- π± The phone will be asked for debugging permission - confirm it.
- π Reconnect the device and check what is in Settings β Debugging is included for developers.
- ποΈ Delete the adbkey.pub file in the.android folder (hidden folder in the userβs home directory).
Mi Flash says "flash is not done"
- π Check the integrity of the archive with firmware (unpack and compare hashes).
- π§ Use it. flash_all_except_storage.bat instead flash_all.bat, preserve data.
- π Try another one. USB-port (preferably) USB 2.0).
7. Security and recommendations
Installing firmware via USB is a process that requires caution, errors can cause data loss or device failure.
Safety regulations:
- π Always check firmware sources β download only from official websites (Xiaomi, XDA Developers).
- π‘ Before the firmware charge the phone at least 60% β a sudden power outage will interrupt the process.
- π Make backup copies through TWRP Mi Cloud before any manipulation.
- π‘οΈ Do not install firmware for other models β even if they are on the same processor (Snapdragon 8 Gen 2) β Snapdragon 8+ Gen 1).
What to do if the phone does not turn on after the firmware:
- Connect to charging for 30 minutes - sometimes helps with the discharge of the battery.
- Try logging into Fastboot (Loudness Down + Power) and reflash the device.
- If the screen is black, use it. EDL-Mode (requires an authorized Xiaomi account).
π‘
To restore the brick through EDL, use the Mi Flash Pro utility with a clean all and lock mode option. But note that this will delete all data and block the bootloader again.