The procedure for updating or restoring the operating system on Xiaomi smartphones is often required when software failures occur, the device is “bricked” or you want to install a custom Android build. Using the ADB command line interface (Android Debug Bridge) and Fastboot mode is the most reliable method of interaction with the system partition of the device when standard methods through the Recovery menu are unavailable or blocked.
Unlike the Airborne Update (OTA), which is limited by user rights, firmware through a computer allows you to bypass many software restrictions and restore the health of even a severely damaged system. However, it is worth noting that working with low-level tools requires care and accurate follow-up of instructions, since an error in one command can lead to complete failure of the gadget. It is critical before starting any manipulations to make a full backup of important data, since the firmware process often involves completely removing all information from the internal drive.
In this guide, we will take a look at how you prepare your computer and smartphone, install the necessary drivers, and the algorithm for flashing your device. We will look at the nuances of working with the ADB utility, commands to put your phone in bootloader mode, and methods for forcibly overwriting system partitions. Even if you are new to the Android modding world, a detailed description of each step will help you succeed.
Workplace preparation and necessary tools
The first step is to organize the right software environment: you need a computer running Windows, macOS or Linux. To work with ADB and Fastboot, you need to download the official SDK Platform Tools from the Android developer site. This is a set of basic tools that contains the executable files adb.exe and fastboot.exe necessary for communication between the PC and the smartphone.
In addition to system utilities, you will need firmware itself. For Xiaomi devices, there are two main types of firmware: Recovery (extension.zip) and Fastboot (extension.tgz). For the method described in this article, we will need Fastboot firmware, since it contains the full image of the system, including a bootloader, radio module and system partition. You should only download files from trusted sources, for example, from the official MIUI Download website or authoritative forums.
Just as important is the physical interface of the connection. Use the original. USB-The cable that came with the smartphone, or the high-quality analogue with data support. Cheap "charging only" cables will not allow the computer to see the device in debugging mode. USB The computer's motherboard is serviceable and provides a stable
power, as the communication break at the critical moment of data recording is fatal.
☑️ Firmware readiness
Check for free space on your computer's system drive. Unpacked firmware files can take anywhere from 3 to 5 gigabytes. It is also recommended to disable antivirus software during the procedure, as it can falsely identify the firmware scripts as a threat and block their execution, which will lead to a process error.
Installation of drivers and activation of debugging
Without the right drivers, your computer won’t be able to recognize your smartphone in special modes. Xiaomi devices most often require Qualcomm HS-USB QDLoader 9008 drivers (for EDL mode) and standard Android Bootloader Interface drivers. In Windows 10 and Windows 11, drivers are often installed automatically when you first connect, but for stable operation it’s better to install them manually through Device Manager.
On the smartphone side, you need to activate the hidden menu for developers. To do this, go to Settings → About the phone and find the MIUI version. Click on it 7-10 times in a row until the notification “You became a developer” appears. Then a new item “For developers” will appear in the “Additional” (or “Extended settings”) menu.
Inside the developer menu, find and activate the USB Debugging Switch. When you connect your phone to your computer in this mode, you'll see a request for debugging permission on your smartphone screen. Make sure you tick "Always Allow from this computer" and click "OK." Without this confirmation, the ADB commands won't be executed.
⚠️ Note: If you plan to unlock the Unlock Bootloader, one debugging by one USB You will need to link your Mi Account to your phone settings and get official permission through the Mi Unlock Tool, which can take 3 to 7 days to wait.
To check for communication, open the Command Prompt (CMD) or PowerShell in the Platform Tools folder and type in the adb device command. If a device with a serial number and device status appears on the list, the connection is established correctly. If the status is unauthorized, check the phone screen for permission request.
Translation of the smartphone to Fastboot mode
Fastboot mode (or bootloader mode) is a state of the device in which it is ready to receive low-level commands to write memory partitions. This mode does not load the Android operating system, which allows you to replace system files without conflicts. You can transfer Xiaomi to this mode software through ADB or hardware using buttons.
The easiest software method is to use the USB debugging already installed: connect your phone to your PC, open the console in the folder with ADB and type in the command:
adb reboot bootloaderThe smartphone will immediately restart and you will see an image with a hare fixing an android, or an inscription. FASTBOOT If the phone doesn't respond to commands, it's orange. ADB (For example, the system is getting stuck, use the hardware method. Turn the device off completely, then press the Volume Down button, and hold it back and plug it in. USB-computer-wire.
After switching to Fastboot mode, check the visibility of the device with the command:
fastboot devicesThe device serial number should be displayed in response. If the list is empty, check the drivers in Windows Device Manager (section "Controllers" USB» or "Portable devices"). The device may be displayed as "Android" or «QHSUSB_BULK» (If it has gone into deep recovery mode).