Installing TWRP on Xiaomi: A Complete Guide from Unlocking to Firmware

Why is TWRP necessary for Xiaomi owners?

TWRP (Team Win Recovery Project) is a powerful tool for advanced users of Xiaomi, Redmi and POCO smartphones that allows you to access functions not available in standard MIUI Recovery. With it, you can install informal firmware like LineageOS or Pixel Experience, create full system backups (nandroid backup), remove built-in MIUI applications without superuser rights, and restore the phone after unsuccessful experiments with firmware.

But installing TWRP on Xiaomi is more complicated than on other brands, and it’s a policy that all modern Xiaomi smartphones come with a bootloader locked, and the unlock process requires official permission through the Mi Account. Moreover, since MIUI 12, the company has implemented Anti-Rollback protection, which can turn the phone into a brick if you choose the wrong version of the Recovery.

In this guide, we will analyze the current method for installing TWRP on Xiaomi for 2026, taking into account all the limitations, including bypassing the protection of Anti-Rollback 4/5, working with fastboot and ADB, as well as solving errors such as Invalid image format or Device not found.

Preparation: What to do before installing TWRP

Before you start unlocking the bootloader and installing a custom recaveri, you need to follow several critical steps, neglecting them can lead to data loss, locking the device or even building it.

First, make sure your device is supported. TWRP. Not all Xiaomi models have stable builds of recovery. for example, for flagships of the Xiaomi series 13/14 or Redmi Note 12 Pro+ There can only be experimental versions, and you can check the compatibility on the official website. TWRP Xiaomi.

  • πŸ“± Create a backup of data: use TWRP Use Mi Cloud, Google Drive or a physical drive.
  • πŸ”‹ Battery charge at least 70%: unlocking and firmware can take up to 30-40 minutes.
  • πŸ–₯️ Install drivers and tools: you will need Mi Unlock Tool, ADB/Fastboot The latest version of Google’s Platform Tools.
  • πŸ”‘ Link the device to Mi Account: without this, unlocking the bootloader is impossible. Make sure that the account is not blocked and has developer rights.

⚠️ Note: On devices with MediaTek processors (e.g. Redmi) 10C, POCO M4 Pro) may require an additional step - disabling protection SLA (Secure Boot, through the engineering menu. TWRP slack.

πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 11/12
POCO X3/X4
Xiaomi 12/13
Another model
I haven't decided yet.

Step 1: Unlock the bootloader on Xiaomi

Unlocking the bootloader is a mandatory step before installing TWRP. Xiaomi requires official permission for this operation, which is issued through the Mi Unlock Tool application. The process can take from a few minutes to 72 hours (depending on the company's policy).

First, turn on the developer mode and allow OEM-unlock:

  1. Go to Settings β†’ About Phone β†’ MIUI version and tap 7 times on this item to activate the developer menu.
  2. Back to Settings β†’ Additionally. β†’ For developers and include: πŸ”“ OEM-unlock (if there is no option, connect the device to the Internet and update it) MIUI). πŸ”Œ Debugging by USB.

Next, download the Mi Unlock Tool from the official website (the version should match your MIUI). Connect your phone to your PC in fastboot mode (turn off the device, then press Volume Down + Power) and launch the tool. Sign in under the same Mi Account as your phone.

⚠️ Note: If the Mi Unlock Tool gives you a Couldn't unlock or Device not bound error, check: Is the phone linked to your account in Settings β†’ Xiaomi account β†’ Mi Cloud: Has this account been used to unlock another device in the past 30 days (Xiaomi restriction).

Link Mi Account to your phone|Turn it on. OEM-unlock|Install the Mi Unlock Tool|Download ADB/Fastboot|Charge the phone before 70%+

-->

Step 2: Install TWRP via Fastboot

Once the bootloader is successfully unlocked, you can start the TWRP firmware. It is important to use a recovery version that is compatible with your model and the MIUI version. For example, this build will work for the Redmi Note 10 Pro (sweet), and for the POCO F3 (alioth) this one will work.

Download the recovery file in.img format and save it to the folder with Platform Tools. Next, execute the following commands in the terminal (pre-transferring the phone to fastboot mode):

fastboot flash recovery twrp-3.7.0_12-0-sweet.img


fastboot boot twrp-3.7.0_12-0-sweet.img

The first command flashes the TWRP into the recovery section, the second temporarily loads it to check its health, and if you see the TeamWin logo after the reboot, then the installation was successful, but on some devices (for example, Xiaomi 11T Pro) Anti-Rollback protection can activate, blocking the boot.

Xiaomi modelCode nameSupported version of TWRPNotes
Redmi Note 11 Pro+ 5Gveux3.7.0_12-0Requires DM Verity Disconnection
POCO X3 Provayu3.6.2_11-0It only works with MIUI 13+.
Xiaomi Mi 11 Ultrastar3.7.0_12-1Support for Dynamic Partition
Redmi 9Tlime3.5.2_9-0No FBE support

πŸ’‘

If after the firmware TWRP The phone loads into a standard recavery, try the command fastboot flash recovery_ab twrp.img partition A/B.

Anti-Rollback and other complications

One of the main problems when installing TWRP on new Xiaomi devices is Anti-Rollback (ARB) protection, which is a mechanism to prevent rollbacks to older versions of firmware. If you try to flash a TWRP that is incompatible with the current version of ARB, the phone will lock with the Anti Rollback Check Fail error.

To avoid this, check your device’s ARB version in fastboot:

fastboot getvar anti

Compare it to the supported version in the build description of TWRP. For example, if your Redmi Note 10 Pro has an ARB 4 and the recovery is designed for an ARB 3, installing it will lead to a brick.

  • πŸ”„ Find a version TWRP supportive ARB (for example XDA Developers).
  • πŸ“‰ Reverse to an older firmware MIUI fitting ARB (riskyly!).

⚠️ Note: On devices with Dynamic Partition (e.g. Xiaomi) 12/13, POCO F4) firmware TWRP It might not work. It requires a modified, supportive Recovery. super.img.

What if TWRP doesn’t see internal memory?
If the /data section doesn't mount or asks for a password after downloading to TWRP, it's due to FBE (File-Based Encryption) encryption. Solution: 1. Go to Wipe β†’ Format Data (this will delete all the data!). 2. Reboot to TWRP and check mounting. 3. If the problem persists, use adb pull /data to back up before formatting.

Install Magisk and Root Rights through TWRP

After successfully installing TWRP, many users are eager to get root rights with Magisk.This process is easier than recovery firmware, but also requires caution. First, download the latest version of Magisk from GitHub (.zip file).

Next, follow the following steps:

  1. Copy Magisk-v26.4.zip to your phone or flash drive.
  2. Download to TWRP and select Install.
  3. Specify the path to the Magisk file and swipe for confirmation.
  4. After installation, reboot to the system.

To check for root rights, install the Magisk Manager application or run the command in the terminal:

su

If you have a permission request, it’s a success, but remember that having root can disrupt some apps (such as banking or Google Pay).

πŸ’‘

Installing Magisk via TWRP doesn’t always give you permanent root. Some devices (such as Xiaomi 12S Ultra) require an additional boot.img patch through Magisk Manager.

Typical errors and their solutions

Even with the correct following of the instructions, users often face problems, and consider the most common errors and ways to fix them:

  • 🚫 Fastboot: Unknown command: Make sure that the folder with Platform Tools is added to the environment variable PATH or run commands from this folder.
  • πŸ”Œ Device not found: Check the drivers ADB, try another USB-Windows can help install drivers through the Mi Flash Tool.
  • πŸ”„ Invalid sparse file format at header: Download another version TWRP Or use the command fastboot flash. recovery_ab Fastboot flash recovery is a fastboot flash recovery.
  • πŸ”’ This MIUI version cannot be installed on this device: Error associated with Anti-Rollback. ARB.

If after installing the TWRP, the phone loads into a standard recaverie, it means that MIUI has overwritten it.

  1. In TWRP, go to Mount β†’ System.
  2. Delete /system/recovery-from-boot.p file (if any).
  3. Sweep through Magisk or another module that blocks the recapvere update.

Recovery of the system after a failed firmware

If, as a result of manipulation, TWRP The phone stopped loading (hung on the logo) MI Or you went to the bootloop, don't panic. In most cases, the device can be restored. TWRP (Loudness up + Food) and perform the following actions:

  1. Make a full backup through Backup (if TWRP is downloaded).
  2. Select the official MIUI firmware via Install β†’ Select Image (select the.tgz or.zip file from the official Xiaomi website).
  3. If TWRP does not load, use the Mi Flash Tool in fastboot mode:
fastboot flash boot boot.img


fastboot flash system system.img




fastboot flash vendor vendor.img

For devices with Dynamic Partition (such as Xiaomi 12), you may need to firmware through fastboot update:

fastboot update miui_V14.0.1.0.TKBCNXM_1234567890_cn_1234567890.tgz

⚠️ Note: If the phone doesn't respond to buttons and is not detected in fastboot, it may be a hard brick. EDL-Emergency boot mode with the box Xiaomi Authorized Account.

FAQ: Frequent questions about installing TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
No, on all modern Xiaomi devices (released after 2016), the bootloader is locked. Without official unlocking through the Mi Unlock Tool, you can't flash TWRP. The exception is some older models on Qualcomm processors where you can use exploits (for example, DirtyCOW), but this is risky.
Why does the phone not see internal memory after installing TWRP?
It's about encryption. FBE (File-Based Encryption, which is used in the MIUI starting with Android 10. To solve the problem, you need to format the section. /data into TWRP (Note: it will delete all data!.The alternative is to use OrangeFox Recovery, which works better with the data. FBE.
How to upgrade TWRP to Xiaomi?
The TWRP update is done in the same way as the initial installation: download a new.img file and flash it through fastboot flash recovery. Importantly, if the new version of the recovery supports a higher version of Anti-Rollback than your current firmware, the update may block the phone.
Will Google Pay work after installing TWRP and Magisk?
No, Google Pay and other banking applications (e.g. SberBank Online) block work on devices with unlocked bootloader or root rights, but you can bypass this protection with the Magisk – Universal SafetyNet Fix module and hide root through MagiskHide.
Can I get back a standard recap after TWRP?
Yes, you need to flash the original recovery.img from the official MIUI firmware. Download the firmware for your model from the Xiaomi website, extract recovery.img and execute the command: fastboot flash recovery.img