How to Install TWRP on Xiaomi: A Complete Guide to Unlocking the bootloader

Installing a custom TWRP recavator on Xiaomi smartphones is the first step to full control of the device, which allows you to install unofficial firmware, back up the system, obtain root rights and even restore bricks after unsuccessful experiments, but the process requires care: a mistake at any stage can lead to a locking of the phone or loss of data.

In this guide, we will analyze the current 2026 methods of installing TWRP for modern Xiaomi models (including the Redmi Note 12 series, POCO F5, Xiaomi 13T), taking into account the changes in the company’s policy to unlock the bootloader. We will pay special attention to the nuances: from choosing the right version of the recovery to bypassing the new restrictions of MIUI. If you are a beginner, do not miss the sections about preparation and backup!

What is TWRP and why is it necessary for Xiaomi?

TWRP (Team Win Recovery Project) is a custom touch-controlled recovery that replaces the standard recovery menu on Android. Unlike stock recovery, it allows you to:

  • πŸ“¦ Install unofficial firmware (e.g. LineageOS or Pixel Experience)
  • πŸ”§ Get root rights through Magisk without losing data
  • πŸ’Ύ Create complete backups of the system (including: /data and /boot)
  • πŸ”„ Restore the phone after a soft brick"
  • πŸ”“ Bypassing some blockages MIUI (For example, restrictions on the region)

On smartphones, Xiaomi TWRP is especially in demand due to the aggressive policy of the company: stock firmware MIUI blocks many functions (for example, changing the region or turning off advertising), and official updates often come with a delay. With custom recovery, you get freedom of action, but lose the warranty - this is important to consider.

⚠️ Attention: Installation TWRP It cancels the Xiaomi warranty. on some models (e.g. Redmi Note 11 Pro)+) after unlocking the bootloader may stop working encryption data - prepare for a complete reset!

Before you go on, check if your model is supported on the official TWRP website: twrp.me/Devices/Xiaomi.New devices (released after 2022) may require a dedicated recovery version with support for dynamic partitions.

πŸ“Š For what purpose do you set TWRP?
Installation of custom firmware
Getting root rights
Backup
Recovery after failure
Experiments with Android

Preparation of the smartphone: unlocking the loader

Without a bootloader, you can't install TWRP on Xiaomi. The unlock process takes 7 to 30 days to protect the company from random action.

  • πŸ“± Xiaomi smartphone with battery charge >60%
  • πŸ’» Computer with Windows/Linux and USB-cable (original cable!
  • πŸ”‘ Mi Account Linked to the Device
  • πŸ›  Mi Unlock Tool (download from official website)

Steps to unlock:

  1. Activate Developer Options: Go to Settings β†’ About Phone and click on MIUI 7 times.
  2. Enable USB Debugging and OEM Unlock in the Developer Menu.
  3. Link the device to your Mi Account in Settings β†’ Xiaomi Account β†’ Mi Cloud.
  4. Launch the Mi Unlock Tool on your PC, log in to your account and follow the instructions. When you first connect, the program will request a wait (usually 168 hours).

⚠️ Note: On models with a MediaTek processor (e.g. Redmi) 10C) Unlocking can lead to loss IMEI. Before the procedure, save it through the engineering menu (#4636##).

Once successfully unlocked, the phone will automatically reset to factory settings. All data will be deleted β€” transfer important files to your PC or cloud beforehand. If the tool detects a "Couldn't unlock" error, check:

  • Is the phone connected in Fastboot mode (black screen with a rabbit)
  • Are the latest Qualcomm or MediaTek drivers installed?
  • Whether VPN or proxy is used (they block Xiaomi servers)

Make a backup of data | Charge your phone >60% | Install Mi Unlock Tool| Enable debugging on USB| Attach Mi Account-->

Selecting the Right TWRP Version for Your Model

Mistakes in choosing a version of the recovery is the most common reason for bricks. For Xiaomi, it is important to consider:

  • πŸ“± Device code name (not to be confused with trademark!) For example, Redmi Note 12 Pro+ It has the name rubens, and POCO F5 β€” marble.
  • πŸ”„ Android version: TWRP Android 12 may not work for Android 13.
  • πŸ”§ Firmware type: for global (Global) and Chinese (China) versions MIUI Different assemblies may be required.

You can get a code name:

  • CPU-Z (Device β†’ Model)
  • B Settings β†’ The phone. β†’ Version. MIUI (for example, V14.0.4.0.TMBCNXM, where TMBCN β€” piece)
  • Xiaomi Flash (Put the model in search)

Once you have identified the code, download TWRP from an official website or trusted sources (such as XDA Developers).

  • Unified – for dynamic partition devices (Android 10+)
  • TREBLE – Supported by Project Treble
  • mauronofrio – popular builds for Xiaomi from a famous developer
Xiaomi modelCode nameRecommended version of TWRPFeatures
Redmi Note 12 Pro+rubensTWRP 3.7.0_12Requires AVB shutdown before firmware
POCO F5marbleTWRP 3.7.0_9-0-mauronofrioSupport for dynamic partitions
Xiaomi 13TaragonTWRP 3.7.0_11It only works with firmware on Android 13
Redmi 10 2022seleneTWRP 3.6.2_11We need to patch. vendor_boot

If you don’t have an official build for your model, you can use generic projects like OrangeFox Recovery or PitchBlack Recovery, but they may not support some features (like FBE encryption).

What if there is no TWRP for my model?
If there is no official version, try: 1. Search for informal builds in XDA or 4PDA (look for themes marked "[UNOFFICIAL]"). 2. Use Fastboot Enhanced, an alternative firmware tool without TWRP. 3. Contact custom firmware developers (such as LineageOS) - they often lay out compatible backs. 4. Wait - new devices usually receive TWRP support for 3-6 months after release.

Install TWRP via Fastboot: step-by-step instructions

The most reliable way to flash TWRP is through Fastboot mode.

  • πŸ–₯ Computer with installed ADB and Fastboot
  • πŸ“ File. twrp-3.x.x-x-Device name.img (rename it to twrp.img convenienceally)
  • πŸ”Œ Original. USB-cables (cheap cables can cause errors)

Instructions:

  1. Connect your phone to your PC in Fastboot mode (turn off the device, then press Power + Volume down).
  2. Open the command line in the folder with the platform-tools and check the connection: fastboot devices must display the serial number of the device.
  3. Squeeze TWRP temporarily (for the test): fastboot boot twrp.img The phone will load into the recave. Check the sensor and basic functions.
  4. If everything works, flash recovery is fastboot. twrp.img For dynamic partitions, use fastboot flash. recovery_ramdisk twrp.img
  5. Reboot to Recovery: Fastboot Reboot Recovery

On some models (Xiaomi) 12T, POCO X5 Pro) after firmware, you need to disable signature verification (AVB), Otherwise, the system won't boot. TWRP execute:

  1. Go to Advanced. β†’ Terminal.
  2. Enter the command: dd if=/dev/zero of=/dev/block/by-name/misc

⚠️ Note: On devices with MediaTek (e.g. Redmi Note) 11) post-fix TWRP It can go down. It's treated with patchy firmware. vendor_boot through TWRP.

fastboot flash disable_miui_anti_rollback 1

This team is disabling the defense mechanism. MIUI, squash-recovery.-->

Solving common installation errors

Even with the correct following of the instructions, problems can arise, and here are the most common mistakes and their solutions:

Mistake.Reason.Decision
FAILED (remote: 'Flashing is not allowed...')The bootloader is not unlockedRepeat the unlocking procedure with the Mi Unlock Tool
Invalid sparse file format at headerThe damaged TWRP fileDownload the image again, check the checksum (MD5)
The phone does not load after the firmwareIncompatible version of TWRP or not disabled by AVBSwipe the stock firmware through the Mi Flash Tool, then repeat with the correct version
TWRP does not see internal memoryFBE encryption or damaged partitionsFormat /data in TWRP (Warning: Delete all data!)

If the TWRP is installed and the phone is loaded into a stock recave, MIUI has overwritten it, so that it can be avoided:

  1. Immediately after the firmware TWRP reboot it (fastboot reboot recovery).
  2. In TWRP, go to Advanced β†’ Flash Current TWRP.
  3. Please. disable_miui_anti_rollback.zip (download XDA).

For devices with MediaTek (like Redmi 10A), you may need to add a patched preloader firmware, without which the phone won’t boot, and look for instructions in your 4PDA model themes.

πŸ’‘

If the TWRP is leaking and the sensor is not working, you have downloaded the version for another model, and you must run the correct version immediately, otherwise you risk getting a brick.

What to do after installing TWRP

Successful installation of the recaveri is only half the battle.

  1. Make a full backup: In TWRP Choose Backup. Tap the sections: Boot, Data, System, Vendor. Save backup to SD-card or PC (internal memory can be encrypted).

Install Magisk for root rights

  • Download the latest Magisk.zip from GitHub.
  • In TWRP, select Install and file.
  • Restart – the Magisk app will appear on the menu.
  • Disable Forced Encryption (if necessary): In TRP: Advanced β†’ File Manager β†’ go to /data/system and delete files: *.key locksettings.db locksettings.db-wal locksettings.db-shm

If you plan to install custom firmware, first check its compatibility with your model on the developer's website.

  • πŸ“± LineageOS – pure Android without unnecessary applications
  • πŸ“± Pixel Experience – firmware with Google Pixel features
  • πŸ“± crDroid – Balance between performance and functionality
  • πŸ“± MIUI EU β€” formal MIUI China-bound

⚠️ Note: After installing custom firmware, Widevine may stop working L1 (no HD into Netflix/Disney+). This is treated with the firmware of a patched vendor or Magisk module.

How to return stock recaps and warranty

If you want to return everything as it was, follow this instruction:

  1. Download the stock firmware for your model from the Xiaomi website (choose the Fastboot version).
  2. Unclose the file and find the images inside the folder.
  3. Fastboot: Fastboot Flash Recovery recovery.img For devices with dynamic partitions: fastboot flash recovery_ramdisk recovery.img
  4. Reboot to stock recavator and run Wipe Data.
  5. Swipe the full stock firmware through the Mi Flash Tool (select the clean all option).

To return the guarantee, you need:

  • Lock the bootloader back (via the Mi Unlock Tool, but this will only work if you haven't changed the anti-rollback).
  • Remove all traces of root rights (in Magisk, select Uninstall β†’ Complete Uninstall).
  • Sending the official firmware through EDL-Mode (requires an authorized Xiaomi account).

Note that new models (Xiaomi 13, Redmi Note 12) are almost impossible to return the warranty β€” the company keeps a log of changes in the persist section, and the service center will find this even after a complete reset.

FAQ: Frequent questions about TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
No, on all modern Xiaomi devices (after 2018), the bootloader is locked at the hardware level, the only exception being some models for the Chinese market (China ROM), where unlocking is not required, but they are not officially sold outside of China.
Why does TWRP ask for a password when downloading?
This is due to File-Based Encryption (FBE) encryption in MIUI. To remove the password request: Enter your PIN/password from your phone (sometimes helps). If it doesn't work, in TWRP, select Wipe β†’ Format Data (remove all data!). For a permanent solution, disable the encryption in the MIUI settings before installing TWRP.
How to upgrade TWRP to a new version?
The update is done in the same way as the original installation: Download the new.img file. TWRP. Choose Advanced β†’ Flash Current TWRP Or go to Fastboot: Fastboot Flash Recovery. twrp_new.img Don't update. TWRP via the official app – it does not support Xiaomi devices!
Can I install TWRP on Xiaomi with a MediaTek processor?
Yes, but there are nuances: On some models (Redmi) 9A, POCO M3) You need to install a patched preloader. TWRP mayhem IMEI β€” Keep it in advance through MTK Engineering Mode. To restore the network, click vendor_boot We recommend that you look for instructions specifically for your model on the 4PDA.
What if the phone does not turn on after installing TWRP?
It's called soft brick. Recovery methods: Swipe stock recaveries through Fastboot: fastboot flash recovery stock_recovery.img Fastboot reboot recovery Then run Wipe Data in the drain Recovery. Use Mi Flash Tool: Download the full Fastboot firmware for your model. Sweat it through the Mi Flash Tool (select clean all).

EDL-mode (for advanced):

  • Requires an authorized Xiaomi account.
  • Connect the phone in EDL mode (clip Volume Up + Volume Down + Power).
  • Fluidify through QFil or Mi Flash Pro.

If nothing helps – contact the service center, but keep in mind that repairs under warranty will not be possible.