Modifying the Android operating system on Xiaomi devices offers unlimited customization and deep customization. One of the most important tools in the enthusiastโs arsenal is TWRP Recovery, which allows you to create full backups of the system, install third-party firmware and obtain superuser rights. The process of implementing this recavereation requires care, but with all the steps it is successful even for beginners.
Before you start taking action, you need to be clear about the risks associated with software interference. Any error in working with partitions can lead to the failure of the device, so preparation is a key step in the entire procedure. Make sure that your smartphone charge is at least 60% to avoid a sudden shutdown at a critical moment. Next, we will discuss in detail all the steps from unlocking the bootloader to the first boot in the modified recovery environment.
Itโs worth noting that modern versions of MIUI and HyperOS have varying levels of protection that can complicate the process. In some cases, successful installation will require the use of specialized utilities on the computer, such as ADB and Fastboot. Weโll look at a universal method that is suitable for most models, from the old Redmi to the current flagships of the Mi and Xiaomi series.
Preparation of equipment and software
You start by providing a stable connection between your computer and your mobile device. USB-cable, preferably original or certified, as cheap analogues often do not provide data transfer, working only on charging. USB Driver, which usually comes with platform tools.
On the computer side, you need to download and unpack the archive with Googleโs Platform-Tools platform tools. This folder contains the adb.exe and fastboot.exe executables that will be used to send commands. Remember to also download the current image of the recovery for your model, as firmware from another device can lead to a โbrickโ.
โ๏ธ Firmware preparation
It is important to check the compatibility of the Android version and the installed MIUI shell with the selected version of the recovery. Often developers release different builds for Android 11, 12 and 13, and using an incompatible file will cause errors when mounting partitions. All the necessary information is usually available on official developer forums or in thematic branches of XDA Developers.
Unlocking the Bootloader bootloader
Xiaomi has introduced a mandatory bootloader unlocking procedure for all devices sold globally and in China, and without this step, installing third-party software is impossible, since the integrity check system blocks any changes to the system partition. First, you need to link your Mi Account to the device through the Developer Menu.
Once tied, you must apply for unlocking through the official Mi Unlock Tool, the process is not instantaneous: the security system requires you to wait a certain time, which can be from 7 to 15 days, this is a measure of protection against device theft and unauthorized access to user data.
โ ๏ธ Attention: The procedure to unlock the bootloader will result in the complete removal of all data from the internal storage of the smartphone. Create backup copies of contacts, photos and documents to the cloud server or computer in advance.
After the waiting timer expires, reconnect in Fastboot mode and press the unlock button in the utility. Successful completion of the process will be confirmed by the corresponding message and vibration of the device. From now on, your Bootloader is considered open, and the boot screen will display an open lock icon or the inscription "Unlocked".
Switching to Fastboot Mode and Connecting
To continue working, the smartphone needs to be switched to a special diagnostic and firmware mode known as Fastboot. On the device turned off, press the volume down button and the power button at the same time. Hold them until an image of a hare repairing an android appears on the screen or the words FASTBOOT.
Connect the device to the computer through USB-Windows Device Manager should have Android Bootloader Interface in the Android Devices or Other Devices section. If an unknown device with an exclamation mark is displayed instead, the drivers are installed incorrectly and need to be manually reinstalled.
You can check the success of the connection through the command line. Open the terminal in the tool folder and type in the command:
fastboot devicesIf you see a set of numbers and letters followed by fastboot, the connection is established. The lack of response indicates a problem with the cable, port or drivers. Make sure you use the USB 2.0 or 3.0 port on the motherboard, not the front panel of the case, where there may be a lack of power.
The process of installing TWRP via Fastboot
Now, we're going to go directly to write the recovery image. The firmware file usually has the.img extension. Rename the downloaded file to twrp.img for convenience and put it in the same folder with the ADB and Fastboot executables. This will make it easier to enter commands and reduce the risk of error on the way to the file.
Run a command to temporarily load the Recovery without its constant installation:
fastboot boot twrp.imgThis method is safe because it doesn't affect the device's memory, and if you're on the TWRP menu after you reboot, it's completely compatible with your hardware, and if the phone is cyclical or frozen, then the version you've chosen is not the right one, and you need to look for another build.
For permanent installation, after successfully logging into the temporary TWRP, follow the following steps:
- ๐ฑ Connect your phone to your PC if it is disconnected.
- ๐ป Copy the file. twrp.img internal memory of the phone.
- ๐ง On the menu. TWRP Select Install and find the file image.
- โ๏ธ Drag the slider to the "Recovery Image" mode at the bottom of the screen".
- โ Confirm firmware swipe.
๐ก
Fastboot boot is the safest way to check the compatibility of a recaveri before permanently recording it in the deviceโs memory.
Save Changes and First Launch
After successfully running the recovery partition, the user is faced with an important question: how to boot into the new TWRP, not the standard system. On many Xiaomi devices, when you normal restart, stock Recovery can overwrite the modified one. To avoid this, you need to immediately reboot to Recovery mode after installation.
In the TWRP menu, select Reboot, then click Recovery. The device will reboot, and if you see Team Win again, the installation was successful. If the phone booted into regular Android, repeat the login procedure through Fastboot again, you may need to reflash and clear the partitions.
| Phase | Action. | The result |
|---|---|---|
| 1 | Unlocking BL | Data reset, access to Fastboot |
| 2 | Temporary loading | Checking image compatibility |
| 3 | Permanent firmware | Entry to the Recovery section |
| 4 | First launch | Verification of stability of work |
The first run may take longer than usual. This is normal, as the system needs to mount new scripts and check the integrity of the files. Don't panic if the Xiaomi or Android logo hangs on the screen longer than 1-2 minutes, give the device time to complete initialization.
Set up and create a backup copy
Once you've successfully logged in to TWRP, the first thing you should do is make a full backup of your current system. This is your insurance policy in case your firmware experiments don't go as planned. Go to Backup and select Boot, System, Data, and Vendor.
Choose a storage location: internal memory or microSD card. If you plan to format internal memory in the future, it is better to copy the backup immediately to your computer. The process of creating a backup can take from 5 to 20 minutes depending on the amount of data.
โ ๏ธ Note: Custom firmware installation often requires formatting the Data partition. If you haven't done a backup in advance, data recovery without losing files will be impossible.
What to do if TWRP asks for a password?
You can also enable logging in TWRP settings, which will help you diagnose errors when installing other modifications, and now your device is ready to install Root rights through Magisk or custom operating systems.
๐ก
If the sound is gone or the camera is not working after installing the TWRP, try clearing the Dalvik/ART Cache section of the Wipe menu before installing the new firmware.
Possible problems and solutions
One common problem is cyclic bootloop after installation, often due to a conflict between Android and recovery versions, which can be helped by a return to the runoff state via the Mi Flash utility and the official firmware in Clean All mode.
Another common mistake is not being able to read the internal memory in TWRP, and it's because of encryption, and the solution is, in the Wipe menu, select Format Data, type "yes" and confirm, and this action will delete all the data, but make the memory available for writing.
If your computer stops seeing your device in Fastboot mode after unlocking, try changing it. USB-Port or cable: Sometimes it helps to reinstall drivers in the Manually Selected Device Manager (Android Bootloader Interface).