Installing the TWRP (Team Win Recovery Project) customized recovery on Xiaomi devices offers unlimited customization options, not just to replace the standard recovery menu, but to create full backups, install modified firmware and obtain superuser rights. The process requires care, as it works with the device bootloader.
Before you start, you need to be clear about the risks: any manipulation of the software part of the smartphone can lead to loss of warranty or, in the worst case, to turn the gadget into a brick. However, with strict adherence to the algorithm of actions, the procedure is successful in the vast majority of cases.
In this article, we will take a detailed look at the entire journey from preparing your computer to first running a modified menu, what tools you will need, how to properly prepare your file system, and what to do if the process goes wrong, and the key is to stay cool and read every step of the instructions carefully.
Tool preparation and backup
You should start with a thorough preparation of the workplace and software. You need a computer running Windows, macOS or Linux, which is working. USB-The cable (preferably original) and the Xiaomi smartphone itself with a battery charge of at least 60%. it is critical to create a full backup of all data, as the process of unlocking the bootloader will completely clear the internal memory of the device.
You need to download and install the ADB and Fastboot package, which is a basic set of drivers and utilities that allow your computer to communicate with your phone in debugging mode, and you also need to download a recovery image (.img file) specially adapted to your smartphone model. Using universal assemblies can cause a touchscreen or cameras to fail in recovery mode.
โ๏ธ Checklist of preparations
Donโt forget to turn on the developer mode on your smartphone. Go to Settings โ About your phone and quickly click on the MIUI build number seven times. After that, the โDevelopersโ item will appear on the menu, where you need to activate โDebugging by USBโ and, crucially, turn on โFactory Unlockโ.
Unlocking the Xiaomi bootloader
Without the Bootloader, you can't install TWRP because the system will check the digital signature of the downloaded partition and reject the changes. This procedure uses the official Mi Unlock Tool. Before you start, make sure that the Mi Account that is used to log in is attached to the device.
โ ๏ธ Note: After applying for an unlock in the application "Mi Unlock Status" may require a wait of 7 to 168 hours.This is a protective mechanism of Xiaomi, and it is impossible to circumvent it by official means.
Unlocking is done in Fastboot mode. Turn off your phone, then press the power and volume buttons simultaneously until a bunny in an orange cap or the Fastboot appears on the screen. Connect the device to your PC and launch the Mi Unlock Tool. The program will check the status of the device and, if it passes, allow unlocking.
When you confirm that you're unlocking, all the data on the phone will be destroyed. This is standard Android security behavior. Once you're done, the phone will automatically restart, and you'll see a message that the bootloader is unlocked. You can now move to the recaveri installation.
Downloading the smartphone in Fastboot mode
Fastboot mode is a low-level protocol that allows you to send commands directly to the device's memory controller. To enter this mode on a switched off Xiaomi smartphone, you need to press the volume button and, holding it, connect it to the device. USB-The screen should show an image that says Fastboot.
If the phone is on, you can use the software method via the command line. If you have the cable connected and USB debugging enabled, then you can follow the command:
adb reboot bootloaderThe computer must identify the device. You can check this with the fastboot device command. If you see the serial number of the device in response, the drivers are installed correctly and the connection is established. If the device is not detected, try another one. USB-Port or cable, and check Windows Device Manager for unknown devices.
It's important not to confuse Fastboot with Recovery. Fastboot is for partitioning, and Recovery is for system maintenance. To install TWRP, we need the first option. Make sure the battery is charged, because in Fastboot mode, the screen can burn constantly, consuming energy.
The process of installing TWRP via Fastboot
Now, to the most critical step, open the command line or the terminal in the folder where the ADB/Fastboot tools and the downloaded twrp.img image file are located. The command to temporarily download the recovery is as follows:
fastboot boot twrp.imgThis command will load the TWRP into RAM, but it won't write it permanently, so that right after you load the recaveri, you can flash it into permanent memory, because the standard MIUI system will replace the custom recaveri with stock one when you first restart it, so after the TWRP menu comes up, don't rush to reboot the phone.
From the TWRP menu, go to Install. Install the bottom right corner, select the "Install Image" button. Find the previously downloaded twrp.img file and select the firmware section, Recovery. Once confirmed, the write process will begin. Once completed, click "Wipe Cache/Dalvik" and then "Reboot System."
๐ก
If after the reboot, the TWRP disappeared and the normal system booted, then you missed the step with the firmware of the image from inside the Recovery itself or did not choose the Recovery partition when installing.
It is worth noting that some new models with dynamic partitions may have different procedures, such as often having to flash the image into the boot section rather than the recovery section, or using special installer scripts. Always check your model theme on the 4PDA or XDA Developers profile forum.
First steps after installation of the recavator
Once installed successfully, you will see the TWRP interface. The first thing you need to do is allow modifications to the system. The TWRP start screen often displays a warning that the bootloader is unlocked and a button, "Swipe to allow modifications." Make sure to swipe your finger, otherwise the system may not boot or replace the Recovery again.
Next, you should clean the partitions, especially if you plan to install custom firmware or patch the system. Go to the Wipe menu and select Advanced Wipe. Check the Dalvik / ART Cache, Cache and Data sections. Pressing the Swipe to Wipe button will clear the selected areas. Internal Storage section is not necessary if you do not want to delete all files (photo, music).
| Section | Description | Should I clean? |
|---|---|---|
| Dalvik / ART Cache | Cash compilation applications | Yes (required) |
| Cache | Temporary system files | Yes (recommended) |
| Data | User data and applications | Yes (for clean installation) |
| Internal Storage | User files (photos, videos) | No (unless you need a full reset) |
If you're planning on getting root rights, now's the time to install the Magisk file. Copy the Magisk apk file (renamed.zip if required by the TWRP version) onto the phone and install it through the Install menu.
Possible mistakes and ways to solve them
There are a number of errors that can occur during the installation process, and one of the most common is Error 7 when installing zip archives, which involves checking the signature in TWRP. This is solved by disabling the verification in the TWRP settings or using the current version of the recovery.
Another common problem is a broken touchscreen in TWRP mode. This means that the image of the Recovery is not suitable for your particular model or screen revision. In this case, you need to look for another build marked as compatible with your device, and reflashing the stock Recovery and trying again with another file can also help.
โ ๏ธ Warning: If the phone goes into an endless restart (bootloop) after installation TWRP, Try going into Fastboot mode and flashing stock image boot.img It's going to bring the phone back to factory status.
Sometimes users face the problem of encrypted partition Data. TWRP You may ask for a password that is yours. PIN-If you don't use a password, you'll have to format the Data partition -> Type "yes" that will delete all files, but remove encryption.
What if TWRP doesnโt see internal memory?
Frequently Asked Questions (FAQ)
Will TWRP reset the warranty on the smartphone?
Can I update the system with an OTA installed TWRP?
Is it safe to use banking applications with TWRP?
How to get back to the stock firmware completely?
Why did the Internet disappear after the TWRP installation?
๐ก
Installing TWRP is the first step to full control of the device, allowing you to install any firmware, make full system backups, and modify system files that are not available in standard mode.