TWRP (Team Win Recovery Project) is an indispensable tool for Xiaomi smartphone owners who want to go beyond the standard capabilities of MIUI. It can install unofficial firmware, create full system backups, obtain root rights or even restore the phone after unsuccessful experiments. However, the process of installing TWRP on Xiaomi, Redmi or POCO devices requires accuracy: here it is important to unlock the bootloader, choose the correct version of the recover, and adhere to the sequence of actions.
In this article, we will discuss the entire process from A to Z: from preparing a smartphone to the final test of TWRP. Particular attention will be paid to the nuances for modern models (2023-2026), where Xiaomi tightened the bootloader protection, and also consider alternative methods for devices with locked OEM Unlock. If you have never worked with ADB or Fastboot before, do not worry: the manual is adapted for beginners, with explanations of each step.
Smartphone Preparation: What to Do Before Installing TWRP
Before you start firmware custom recaveri, you need to follow a few critical steps, skipping any of them can lead to a breeze device (complete inoperability) or inability to complete the process.
First, check your smartphone model and codename (e.g., Redmi Note 12 Pro+ is ruby, and POCO F5 is marble). You can find out the codename in the settings (Settings β About Phone β MIUI version, tap multiple times on the Kernel) or by using the command:
adb shell getprop ro.product.deviceSecond, make sure that the phone is USB debugging enabled and OEM unlocked. These options are hidden in the developer menu, which is activated like this:
- Go to Settings. β The phone.
- Find the MIUI version and tap it 7 times until you become a developer!
- Return to the main settings menu, open Additional β for developers.
- Activate the USB Debugging and OEM Unlock switches.
π‘
If the OEM Unlock is inactive or not, it means that the manufacturer has blocked it for your model, in which case you will need to use bypass methods (see the section "Alternative ways of unlocking").
Finally, prepare a computer with:
- πΉ Android SDK Platform-Tools (for teams) ADB and Fastboot).
- πΉ Xiaomi drivers for your model (you can download on the official website).
- πΉ File. TWRP.img For your model (download only from the official website) TWRP or trusted sources like XDA Developers).
Unlock the bootloader on Xiaomi: the official way
Xiaomi blocks the bootloader on all its devices, so without it unlocking, you canβt install TWRP. The official method involves using the Mi Unlock Tool utility, but it has limitations:
- πΈ Suitable only for Mi accounts that are tied to the device for at least 7 days.
- πΈ Some models (such as the Redmi Note 12 or Xiaomi 13) require a wait of up to 360 hours (15 days) after pegging.
- πΈ Does not work on devices with MIUI China ROM global-hardware.
To unlock the loader:
- Download the Mi Unlock Tool and install it on PC.
- Log in to your Mi Account on your phone and utility.
- Connect your smartphone to your computer in Fastboot mode (turn off your phone, then press Volume Down + Power).
- In the utility, press Unlock and follow the instructions.
What if the Mi Unlock Tool gives you a "Couldn't unlock" error?
Once successfully unlocked, the phone will automatically reset to factory settings. All data will be deleted, so back up in advance!
Alternative ways to unlock the loader
If the official method didnβt work (for example, due to a Couldnβt unlock error or the lack of an OEM Unlock option), you can try workarounds, which are suitable for advanced users and require caution.
One of the working methods is the use of EDL-mode (Emergency Download Mode) using the Mi Flash Pro tool. This method allows you to flash the device bypassing the lock, but has risks:
- π¨ Hard-brick (complete loss of performance) is possible with incorrect actions.
- π¨ Requires an authorized Xiaomi account with rights EDL (You can buy them from trusted vendors on forums like XDA or 4PDA).
- π¨ It doesnβt work on new Qualcomm Snapdragon chips 8 Gen 2/3 (for example, Xiaomi 14 or Redmi K70).
The algorithm of actions in EDL:
- Download Fastboot ROM firmware for your model from the official website.
- Unpack the archive and delete the file flash_all_lock.bat (It locks the bootloader after the firmware is done).
- Transfer the phone to EDL mode: adb reboot edl Or manually: turn off the phone, press Volume up + Volume down and connect to the PC.
- In Mi Flash Pro, select the unpacked firmware and press Flash.
Install TWRP Recovery via Fastboot
When the bootloader is unlocked, you can start the firmware TWRP. This process takes no more than 5-10 minutes, but requires accurate execution of commands.
First, download the correct version of TWRP.img for your model.
- β οΈ Versions TWRP Snapdragon and Mediatek are not interchangeable.
- β οΈ For certain devices (e.g, POCO X5 Pro) requires a special assembly with Dynamic Partition support.
- β οΈ Check the build date: Old versions (2022 a year or earlier, may not be able to MIUI 14/15.
Now, follow the following steps:
βοΈ Firmware preparation TWRP
- Place the TWRP.img file in the folder with the platform-tools (where adb.exe and fastboot.exe lie).
- Open the command prompt in this folder (Shift + right mouse button β Open the PowerShell window here).
- Check the connection of the device: fastboot devices should display the serial number of the phone.
- Sweep TWRP: fastboot flash recovery twrp.img (replace twrp.img with the actual file name).
- Reboot your phone to Recavator: fastboot boot twrp.img
π‘
The fastboot boot command temporarily loads the TWRP without firmware in the device's memory, which allows you to check the recovery's performance before permanent installation.
If the TWRP boots successfully, you can lock it into the system.
- On the menu. TWRP Choose Advanced β Flash Current TWRP (If there is no such option, please TWRP.zip conventionally ZIP-file).
- Reboot to the system.
Problems with installing TWRP and their solutions
Even with the correct following of the instructions, errors can occur, and let's look at the most common ones and how to fix them.
| Mistake. | Reason. | Decision |
|---|---|---|
| FAILED (remote: 'Flashing is not allowed in Lock State') | The bootloader is not unlocked | Re-unlock with the Mi Unlock Tool or EDL |
| Invalid sparse file format at header | The damaged TWRP.img file | Download the file again from the official source |
| The phone does not boot after installing TWRP | Incompatible version of the recovery or damaged firmware | Sweep the original recovery.img through Fastboot or use the Mi Flash Tool |
| TWRP asks for password when downloading | Data Encryption (FBE) in MIUI | Enter your phone password or format /data (loss of data!) |
If the phone loads into a standard MIUI recavator after installing the TWRP, it means that the system has overwritten it.
- Right after loading in TWRP thread disable_dm-verity_forceencrypt.zip (disables integrity verification and forced encryption).
- Or edit the vendor/build.prop file by deleting ro.boot.verifiedbootstate=orange.
π‘
On some models (e.g. Redmi Note 11 Pro+), TWRP may not see internal memory, in which case, connect your phone to your PC in MTP mode directly from the recovery menu and copy the files you want through the Explorer.
What to do after installing TWRP
Successful custom recavator installation opens up a lot of opportunities for customization of Xiaomi.
- π¦ Install Magisk to get root rights: Download Magisk.zip β Boot in. TWRP β Install β Select a file β Swipe to Confirm Flash
- π Make a full backup of the system (backup in the system) TWRP), including Boot, System and Data.
- π± Swipe custom firmware (such as LineageOS or Pixel Experience).
- π§ Disable Forced Encryption (FBE), if it interferes with the work.
However, keep in mind the risks:
- π« Loss of warranty (if the device is warranty, return the standard recovery before contacting the service).
- π« Possible problems with MIUI OTA-Updates (they can break) TWRP).
- π« Risk of blocking the Mi Account in case of incorrect manipulations with firmware.
π‘
Once rooted, some apps (such as banking or Google Pay) may stop working, requiring root hiding using Magisk Hide or Universal SafetyNet Fix to work properly.
Security and Recovery Councils
Working with custom recoveries and firmware always comes with risks. To minimize them, follow these recommendations:
1. Always backup before you run your firmware. In TWRP, select all partitions (Boot, System, Data, Vendor) and save a copy to an external drive or PC.
2. Check checksums for downloaded files (e.g. TWRP.img or Magisk.zip) to prevent corrupted or malicious files from being firmwareed.
3. Do not update via OTA after installing TWRP. MIUI updates can overwrite backpacks or cause conflicts. Instead, download full firmware (Fastboot ROM) and stitch them manually.
4. Use proven sources to download firmware and modules.
- π Official website TWRP
- π XDA Developers (partitions for your model)
- π Xiaomi community telegram chats (e.g, @miuiru or @xiaomifirmware)
π‘
If the phone doesnβt turn on after a bad firmware (brick), try bringing it back to life with the Mi Flash Tool in Clean All mode. This will reset the device to factory state, but will retain the ability to unlock the bootloader.