Xiaomi smartphone owners often face the limitations of the standard operating system, especially when it comes to superuser rights or installing global firmware. One of the key stages of deep device modification is installing custom Recovery mode, which allows you to back up, clean partitions and install informal Android builds. The traditional method of installing via a computer using Fastboot mode remains the most reliable and versatile way, working even on locked or damaged systems.
The process of replacing stock recovery with a modified one, such as TWRP or OrangeFox, requires care and strict adherence to the sequence of actions. Errors at this stage can lead to data loss or software failure, so it is important to understand not only the mechanics of actions, but also the logic of the Bootloader bootloader. In this article, we will discuss all the nuances of preparing, setting up the environment and direct firmware of the image through console commands.
Before you start manipulating system partitions, you need to make sure that your device is fully ready for intervention, which implies the presence of an unlocked bootloader, an ADB and Fastboot driver installed, and a.img file tailored specifically for your model. Ignoring the compatibility requirements of the Recovery version and the Android version can lead to the inoperability of the touchscreen or the inability to boot into the system.
Preparation of the working environment and device
Start with a stable connection between your computer and your smartphone. To work in Fastboot mode, it is critical to use high-quality communication. USB-cable, preferably original, and connect it directly to the motherboard ports, avoiding the front panels of the system unit or USB-The computer must have up-to-date drivers installed. ADB Fastboot, which can be found in Googleβs Platform Tools or in specialized builds for Xiaomi.
On the smartphone side, you need to activate the hidden developer menu. To do this, go to Settings β About the phone and quickly press 7-10 times on the MIUI version (or HyperOS) until the activation notification appears. Next on the Additional menu β For developers, you need to include Debugging by USB and Factory Unlock. Without these settings, the computer will not be able to send commands to the device.
An important step is to check the status of the bootloader. If it is blocked, the firmware command will be rejected by the server or the device itself. Make sure you have passed the official unlock procedure through the Mi Unlock Tool utility and obtained the appropriate permission. It is also worth making a full backup of important data, since the process of modifying system partitions always carries risks.
βοΈ Firmware readiness
Translation of the smartphone to Fastboot mode
There are several methods to enter bootloader mode, but the most reliable is the hardware. Turn off the smartphone completely and wait for the logo to vibrate or disappear from the screen. Then press and hold the Volume Down button and, without letting it go, plug it in. USB-The device should display a distinctive Fastboot logo with a picture of a hare repairing an android, or a sign that reads FASTBOOT.
There's also a software way of logging in, if the system is stable, and you can send a command through the command line on your computer, if you're in the ADB tool folder, and you can send a command.
adb reboot bootloaderWhen you go to Fastboot, check the connection. In the PC command line, type in the command command fastboot devices. If you see your device's serial number in response, the drivers are installed correctly and the smartphone is ready to receive. The lack of response may indicate problems with the cable, port or drivers, which must be fixed before the firmware begins.
π‘
If your computer canβt see your phone in Fastboot mode, try another one. USB-Port or cable. Sometimes it helps to install Xiaomi drivers in the Device Manager manually.
Finding and Verifying Recovery Image Compatibility
The key to success is choosing the right firmware file. Recovery is not a universal application, but a system image sharpened for a specific hardware. Installing an image from another model, even from the same line (for example, from the Redmi Note 10 to the Redmi Note 10 Pro), can lead to a brick of the device or a touchscreen in recovery mode.
Search files should be on trusted resources, such as the official forum XDA Developers, Telegram channels from well-known developers or specialized sites like 4PDA. Usually, the file has an extension.img and a name containing the code name of the device (for example, twrp-3.7.0_12-0-vayu.img). You can find out the code name in the About phone menu or through the command fastboot getvar all.
Once downloaded, it is recommended to check the integrity of the file. Often developers specify a checksum (MD5 or SHA256). If the file is damaged during download, the firmware process can be successful, but the Recovery itself will not start or will work with errors. Place the file in the root folder Platform Tools on your computer for easy command entry.
β οΈ Warning: Never use Recovery images that are only for a specific version of Android if you plan to roll back on an older version of the system.
Installation process through the command line
Now, to the direct firmware, open the command prompt (CMD) or PowerShell in the Fastboot tool folder. Make sure the phone is in Fastboot mode and connected. Enter the command to write the image into the recovery section. The command syntax is as follows:
Fastboot flash recovery name file.imgFor example, if your file is called twrp_xiaomi.img, The team will be: fastboot flash recovery twrp_xiaomi.img. After pressing Enter, the process will take a few seconds. the console should see a message Finished. Total time: X.XXXs. This means that the image is successfully written to the corresponding partition of the device memory.
There is an important nuance for Xiaomi devices: Immediately after the firmware is uploaded, a standard bootloader may try to reboot to stock Recovery, ignoring the one just installed. To avoid this and immediately enter the new mode, use the command:
fastboot boot name file.imgThis command doesn't record the image permanently, it runs it one-time from RAM, and it's the perfect way to test Recovery before it's finalized. If everything works correctly (touch is running, partitions are visible), you can record the result with a flash command again, or you can just reboot it if the image has already been recorded by the flash command.
Solving common problems and errors
Users often encounter errors during the firmware process, and one of the most common is FAILED (remote: device is locked), which means that the device bootloader is locked, in which case, third-party Recovery firmware is impossible without first unlocking through the official Xiaomi Mi Unlock service.
Another common problem is the FAILED (remote: partition flashing is not allowed) error, which can occur on devices with anti-Rollback protection enabled or when trying to flash an image that does not match the current version of the bootloader. It is also worth considering that on some new models with dynamic partitions, the command may differ or require preliminary manipulation of the partition table.
If after firmware the phone goes into a cyclic reboot (bootloop) or Recovery gives an error error-1 attempt installation ZIP-The data section may be encrypted with a key that the new Recovery cannot read, and in such cases, it is often necessary to format the Data partition (not to be confused with Wipe) directly from the Recovery menu.
| Fastboot bug | Probable cause | Decision-making |
|---|---|---|
| FAILED (device is locked) | bootloader locked | Unlocking with Mi Unlock Tool |
| FAILED (remote: flash write failure) | Problems with cable or port | Replace the cable, connect to another USB port |
| waiting for device | Drivers not installed | Install ADB/Fastboot drivers manually |
| FAILED (remote: partition flashing is not allowed) | Anti-Rollback or Wrong Image Protection | Verify the compatibility of the version and region |
What to do if IMEI disappears after the firmware?
First Start and Basic TWRP Setup
After successfully installing and first logging into the Recovery menu (usually a screen with Install, Wipe, Backup buttons), the system can request a screen unlock password. This is data protection: Recovery is encrypted with a key associated with your pin code or pattern lock. Enter it to gain full access to the file system.
If you plan to use a phone with Root rights, now is the time to install Magisk. ZIP-Magisk archive on the phone (via MTP or ADB Sideload) and install it via the Install menu.Important: on Xiaomi devices, after installing custom Recovery and Magisk, you often need to format the Data partition (Format Data button). β Type the word yes to remove encryption and avoid cyclical reboot.
The final step is to reboot the system. Press Reboot β System. The first run can take longer than usual (3 to 10 minutes). If the system boots, congratulations: you successfully modified your device. Now you have full control of the file system and the ability to install any modifications.
π‘
Formatting the Data (Format Data) partition is a must when you first install custom Recovery on Xiaomi if you want to avoid encryption and bootloop issues.