Modifying the Android shell opens up huge opportunities for Xiaomi smartphone owner that are not available in stock firmware. Installing a customized recavator such as TWRP or OrangeFox is the first and most important step towards full control of the device, and it is through this tool that users gain superuser rights (Root), install global firmware on Chinese versions or create full backups of the system.
Replacing the normal recovery mode requires careful understanding of the bootloaderβs architecture. Unlike a regular software update, here we interfere with low-level memory partitions, which carries certain risks if the technology is broken. However, if you follow the instructions clearly and understand the meaning of each ADB and Fastboot command, the likelihood of turning the phone into a brick is minimized.
In this guide, we will take a detailed look at the entire journey from unlocking the bootloader to the first successful boot into a modified recovery environment, and we will look not only at the standard scenario, but also at the nuances of modern models with Snapdragon and MediaTek processors. Preparedness for the procedure and availability of a worker USB-Cable is where the path to customization begins.
Preparation of tools and drivers for working with ADB
Before connecting a smartphone to a computer, you need to prepare a software environment. The basic element is the Platform-tools package containing executable files adb.exe and fastboot.exe. Without these slits, any communication with the device in debugging or bootloader mode will be impossible.
The critical step is to install the right drivers. Xiaomi devices often require Qualcommβs HS-USB QDLoader 9008 universal driver (for crash recovery modes) and the standard Android Bootloader Interface. If Windows Device Manager displays an unknown device or device with an exclamation mark when connecting a smartphone in Fastboot mode, commands will not be executed.
You also need the recovery image file itself with the.img extension. It's important to download a version that strictly matches your smartphone model. 10, on the Redmi Note 11, This will cause the touchscreen to fail or the download to be completely blocked. recovery.img And put it in the root folder with tools. ADB command-in.
β οΈ Warning: Make sure the battery is at least 60% battery power. interrupting the process of writing data to the Recovery partition due to battery discharge can lead to a failure of the boot sector.
Unlocking the bootloader: a mandatory stage for Xiaomi
Xiaomi has implemented strict protection against unauthorized software modifications, so custom Recovery firmware is impossible without an unlocked bootloader. The regular bootloader signs all sections with a digital key, and any attempt to change the system image without removing the lock will be rejected. First, you need to link the Mi Account account to the device through the βDevelopersβ menu.
Once you have an account attached, you have to wait a certain amount of time, which is usually 168 hours (7 days), but in rare cases, the timer can be extended to 30 days, during which time you can not log out of your account on your device or reset your settings, otherwise the countdown will start again, a security measure designed to protect your data in the event of a device being stolen.
After the waiting period, the procedure is performed through the official Mi Unlock Tool utility. The smartphone is transferred to Fastboot mode (clamping the volume button when connecting USB), after which the program checks the status of the account and gives permission to unlock. The process completely clears the internal memory of the device, so the preliminary creation of a data backup is mandatory.
Set up debugging and enter Fastboot mode
For a PC to communicate successfully, you need to activate the hidden developer menu. On most MIUI and HyperOS shells, this is done by seven times pressing the build number in the About Phone section. Once the "You've become a developer" notification appears, you should go to the advanced settings and turn on the Debugging on USB.
When the first cable is connected to the computer on the smartphone screen, a request for debugging permission with a fingerprint will appear. RSA-You need to check "Always allow from this computer" and click "OK." If you don't do that, ADB-The demon will not have sufficient rights to execute commands, and the device will appear as "unauthorized" when checking status.
Transfer of the device to Fastboot mode is carried out by completely turning off the smartphone and then pressing the volume reduction button when connecting USB-The screen should show the distinctive logo of the hare repairing the android, or the inscription FASTBOOT. In this mode, the phone waits for low-level commands to work with memory partitions.
adb reboot bootloaderThis command can be used to automatically navigate to Fastboot if the phone is on and debugging is active. Once the command is executed, the device will reboot to the desired mode without mechanically pressing the buttons.
Recovery Firmware Process Through Command Prompt
When the preparatory steps are complete, you can go to the direct recording of the image. Open the command line (CMD) or PowerShell in the folder with the Platform-tools tools. First of all, check the visibility of the device with the command fastboot devices. If you see the serial number of the device in response, then the drivers are installed correctly and the connection is established.
The basic firmware command looks standard, but has its own features on different versions of Android. For most modern Xiaomi devices, the following instruction is used:
fastboot flash recovery recovery.imgHowever, there is an important nuance associated with the mechanism of A/B-partitions (Seamless Updates). On devices with such architecture (for example, Xiaomi Mi 9, Redmi Note 8 and later), the command may differ, or after firmware you will need to manually switch the active slot. If after standard firmware the phone loads into stock boot Recovery instead of TWRP, try the command fastboot recovery.img for the first run, and already inside TWRP fix it permanently.
βοΈ Checklist before firmware
Once the process is successfully completed (OKAY and Finished status), you canβt just turn on the phone with the power button. On many new Xiaomi models with AVB (Android Verified Boot) activated, the standard system may not start if it detects changes in the Recovery section, so you often need to press the button combination immediately after firmware is installed to enter recovery mode.
Typical errors and methods of their elimination
One of the most common problems is the FAILED (remote: device is locked) error, which occurs when you try to flash Recovery onto a locked bootloader, and you need to go back to the unlock phase through the Mi Unlock Tool, which is impossible to ignore because the bootloader physically forbids you from writing to secure partitions.
Another common situation is that the phone goes into an endless restart (bootloop) after installation. TWRP. This may be due to incompatibility of the Recovery version with the Android version (e.g. firmware). TWRP Android 11 on Android 13, and the problem may be damaged. USB-a cable or port through which data transmission was interrupted during recording.
| The CMD Mistake | Probable cause | Decision |
|---|---|---|
| FAILED (remote: unknown command) | Wrong syntax or old Fastboot | Check the path to the file, update the Platform-tools |
| FAILED (status mismatch) | Conflict of loader versions | Use the Fastboot version from the firmware |
| FAILED (remote: flash write failure) | Problems with memory or cable | Replace USB-cable, try another port USB 2.0 |
| waiting for device... | Drivers not installed | Install Xiaomi/Qualcomm drivers manually |
If you encounter an error that is not described in the table, try using another one. USB-port, preferably USB 2.0, Some older versions of Fastboot are not stable with ports. USB 3.0/3.1. It also makes sense to double-check the integrity of the downloaded image file through a checksum (MD5/SHA1), If provided by the developer of Recovery.
What if TWRP doesnβt see internal memory?
First Start and Basic TWRP Setup
After the firmware is installed, it is important to correctly enter the first one. Press the volume button and the power button (on some models, only power if the Recovery is already fixed). If you see the Xiaomi logo, and then the standard Mi-Logo screen that says "Powered by Android", but the TWRP menu does not appear - perhaps the system overwrote Recovery back to stock, in which case the fastboot procedure should be repeated and flash buttons immediately pressed.
When you first run the TWRP, you can ask for a screen unlock password. This is standard data protection. If you don't remember the password or it's not accepted, you'll have to format the data, which will delete all the information. Recovery interface can be in English or Chinese, but the basic functions (Install, Wipe, Backup) are intuitively located.
For stable operation, it is recommended to perform the following actions immediately after installation:
- π± Swipe to Allow Modifications: Swipe across the screen to allow modifications, otherwise the system may replace Recovery again when you restart.
- π Format Data: If you plan to install custom firmware, be sure to complete the full formatting.
- πΎ Backup: Backup your Boot and System partitions before any further experiments.
π‘
If you plan to install firmware with Google services (GApps), do so immediately after installing TWRP, before the first start of the system, and this will eliminate the need to re-enter Recovery mode.
Now your device is ready to install custom firmware, Magisk patches for Root rights, or just to create full backups. The ability to work with ADB and Fastboot opens the door to a world of deep customization, allowing you to extend the life of even outdated smartphone models.
π‘
Successful firmware Recovery through ADB is possible only with unlocked bootloader and the right drivers. Violation of the sequence of actions or the use of incompatible files is the main cause of failure.