Installation of TWRP on Xiaomi: from unlocking the bootloader to firmware recaveri

Why to Install TWRP on Xiaomi

TWRP (Team Win Recovery Project) is a powerful tool for Xiaomi smartphone owners that allows you to access features not available in standard MIUI recovery mode. With it, you can install informal firmware, create full system backups, recover data after crashes or even β€œreanimate” the device if it stops booting. But it is important to understand that installing TWRP is not just a couple of buttons, but a multi-step process with risks.

The main difficulty is that Xiaomi actively blocks the possibility of installing third-party recovers on new models, the manufacturer introduces restrictions through a locked bootloader, firmware signature verification (Anti-Rollback), and even hardware protections at the chipset level. However, for most devices (especially releases before 2023), circumventing these restrictions is still possible - provided that instructions are strictly followed.

This article covers current methods of installing TWRP on Xiaomi in 2026, including unlocking the bootloader, choosing a compatible version of the backup and firmware via Fastboot or ADB. We will also discuss common errors (for example, Invalid sparse file format at header) and how to fix them. If your goal is just to get root rights, Magisk without TWRP may be enough, but there is no alternative to deep customization of the system.

Preparation: What to do before installing TWRP

Before you start firmware, make sure that all the prerequisites are met. Missing at least one item can lead to a "brick" of the device (complete failure) or inability to complete the process.

  • πŸ“± Check the device model: TWRP Redmi Note 10 Pro is not suitable for POCO X3 Pro, even if the chipsets are similar. Find out the exact model in Settings β†’ The phone. β†’ Model.
  • πŸ”“ Unlock the bootloader: Without this step, stitch TWRP It's impossible. More details are in the next section.
  • πŸ’» Install. ADB Fastboot: Google’s Platform Tools are required (you can download from the official website).
  • πŸ”‹ Charge your phone at least 60%: Interrupting the process due to battery discharge often leads to a software blink.
  • πŸ“ Create a backup of data: Installation TWRP can erase user files, especially if you need a factory reset.

Pay special attention to the choice of version TWRP. The official builds are presented on the twrp.me website, but for many Xiaomi models, the current versions are published on the forums. XDA Developers or 4PDA. For example, for Xiaomi Mi 11 You may need a special assembly with support dynamic_partitions, Otherwise, the firmware will end in error.

πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 10/11/12
POCO F/X
Mi 10/11/12
Another model
I haven't decided yet.

Also check if your device is subject to the Anti-Rollback restrictions.This protection system blocks rollbacks to older versions of MIUI or firmware from older versions of TWRP. A list of Anti-Rollback devices can be found at xiaomi.eu. If your model is on the list, use only the recommended versions of the recovery.

πŸ’‘

Download the TWRP firmware in.img and rename it twrp.img for convenience. Store the file in the folder with the platform-tools so you don't have to specify long paths when you type commands.

Unlocking the bootloader on Xiaomi: step-by-step instructions

The bootloader on all Xiaomi smartphones is blocked by default. Unlocking it is a mandatory step before installing TWRP. The process takes from 72 hours to 1 week due to the verification of the Mi Account.

  1. Link the device to your Mi Account: Go to Settings β†’ Mi Account β†’ Data sync and make sure the phone is linked to your account. Without this, unlocking is impossible.
  2. Enable USB debugging: Activate Developer Mode by tapping 7 times on the MIUI version in Settings β†’ About Phone. Then turn on USB Debugging in Settings β†’ Additional β†’ Developer.
  3. Link your account to your device: In the same developer menu, find Mi Unlock Status and link your account to your phone.
  4. Download Mi Unlock Tool: The official utility is available on the Xiaomi website (registration required).
  5. Open unlock: Connect your phone to your PC in Fastboot mode (turn off the device, then press Volume Down + Power), launch the Mi Unlock Tool, and follow the instructions. The first attempt usually ends in an error requiring you to wait 72 to 168 hours.

After successfully unlocking the bootloader, a warning will appear on the phone screen This device is unlocked every time it boots. This is normal and does not affect the device's performance.

What if the Mi Unlock Tool can’t see the device?
1.Make sure drivers are ADB set (download here). 2. Try another one. USB-cable (preferably original). 3. Disable driver signatures in Windows (instructions here). 4. Launch Mi Unlock Tool on behalf of the administrator.

⚠️ Warning: Unlocking the bootloader resets all data on the phone! make a backup of photos, contacts and other important files before starting the procedure. Also note that some banking applications (for example, Sberbank Online) may stop working on devices with an unlocked bootloader.

Selection of TWRP version: official assemblies vs custom ports

Not all versions. TWRP The official builds from twrp.me often become outdated and do not support new features. MIUI, such as dynamic_partitions (dynamic partitions) or encryption FBE (File-Based Encryption. So many models have to use custom ports from the community.

Type of assemblyAdvantagesDeficienciesWhere to download
Official TWRPStable work, minimal risk of errorsOften outdated, no support for new chipsetstwrp.me
Castom Port (OrangeFox, SkyHawk)Support for new features, optimization for MIUIMay contain bugs, require review checksXDA, 4PDA
TWRP with support for threadIt works on devices with dynamic_partitionsMore difficult to install, requires additional commandsXDA Themes for a Specific Model

Qualcomm Snapdragon-based devices (such as the POCO F3 or Redmi K40) often use OrangeFox general-purpose builds that support A/B partitions and encryption. While MediaTek models (such as the Redmi Note 11) may require a special version with a patch for mtk-client.

Before downloading, check:

  • πŸ“Œ Compatible with your exact model (e.g. Redmi Note 10 Pro and Redmi Note 10 Pro Max are different devices!).
  • πŸ”„ Version MIUI: assemblies TWRP They only work with specific versions of the firmware.
  • πŸ”’ Anti-Rollback: If your device supports it, use only the recommended versions.

πŸ’‘

For devices with dynamic_partitions (for example, Xiaomi 12/13 series required TWRP supportive --disable-verity --disable-verification. Without this, the firmware will end with an error in the Invalid sparse file format.

Install TWRP via Fastboot: a step-by-step process

The most reliable way to flash TWRP is through Fastboot mode, which works on most Xiaomi devices, including those that block access to the recovery via ADB.

β˜‘οΈ Firmware preparation TWRP

Done: 0 / 5

Instructions:

  1. Transfer the phone to Fastboot mode: adb reboot bootloader Or manually: turn off the device, then press Volume Down + Power.
  2. Check the connection: fastboot devices should display the serial number of the device. If not, check the drivers.
  3. Please. TWRP: fastboot flash recovery twrp.img For devices with dynamic_partitions Use: Fastboot Flash recovery_ramdisk twrp.img
  4. Disable Recovery Replacement (important!): fastboot flash vbmeta vbmeta.img fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img If vbmeta.img is not available, skip this step.
  5. TWRP: Fastboot Reboot Recovery

After first downloading to TWRP, you may need to enter a graphical key or password (if encryption was enabled). If the device requests permission to modify the system partition, choose Keep Read Only (otherwise you risk getting a bootloop).

⚠️ Note: On some devices (e.g. Xiaomi) 11T Pro) after firmware TWRP In the standard way, the Recovery can be automatically replaced with stock when you first restart. TWRP plough disable_dm-verity_forceencrypt.zip (download XDA).

Installation of TWRP via ADB (alternative method)

If for some reason the firmware through Fastboot fails (for example, the device is not detected), you can try installing TWRP through ADB in sideload mode, which is suitable for devices where the bootloader is already unlocked, but standard recavers do not allow you to flash custom.

Instructions:

  1. Download the TWRP file in.zip (not.img!) format.
  2. Reboot the phone to the stock recavator: turn off the device, then press Volume up + Power.
  3. From the Recovery menu, select Apply update β†’ Apply from ADB.
  4. On PC, run the command: adb sideload twrp.zip
  5. After the firmware is complete, reboot to TWRP: adb reboot recovery

This method is less reliable than Fastboot, as Xiaomi’s stock recavator can block the installation of unsigned zip files. If the process ends with a Signature verification failure, try:

  • πŸ”§ Use a different version TWRP (For example, OrangeFox instead of the standard build).
  • πŸ”„ Disable signature verification in the drain Recovery (if available).
  • πŸ“₯ Sweep TWRP via Fastboot (described in the previous section).

Typical TWRP firmware errors and their solutions

Even if you follow the instructions, you may encounter errors, and here are the most common problems and ways to fix them:

Mistake.Reason.Decision
Invalid sparse file format at headerIncompatibility TWRP s dynamic_partitionsUse it. TWRP supportive --disable-verity or flash vbmeta.
Failed to boot into recoveryStock Recavery Re-records TWRPPlease. disable_dm-verity_forceencrypt.zip post-installation TWRP.
Device not found in Fastboot/ADBProblems with drivers or cableInstall drivers manually, try another one USB-port (preferably) USB 2.0).
The phone does not turn on after the firmwareBoot section or incorrect version of TWRP damagedSwipe the stock firmware through the Mi Flash Tool (instruction below).

If after installing TWRP, the phone bootloop (infinite reboot), try:

  1. Reflash TWRP with another version.
  2. Delete /data/.twrp file via ADB: adb shell rm -rf /data/.twrp
  3. Reset with TWRP: Wipe β†’ Format Data (delete all data!).

If none of these methods work, you just have to run the stock firmware through the Mi Flash Tool.

  1. Download the firmware for your model from the Xiaomi website.
  2. Unpack the archive and launch the Mi Flash Tool.
  3. Connect your phone in Fastboot mode and select a folder with firmware.
  4. Press Refresh, then Flash (select Clean all for a full reset).

What to do after installing TWRP

Successful TWRP is only half the battle, so you need to set up the Recovery properly and protect it from being overwritten with stock, and this is what you should do right after you install it.

  • πŸ” Turn off forced encryption: Please disable_dm-verity_forceencrypt.zip (download XDA). This will prevent loading problems after modifications.
  • πŸ“¦ Create a full backup: In TWRP Select Backup and save Boot, System, Data, Vendor partitions. Store backup on PC or cloud.
  • πŸ”„ Install Magisk for root rights: Download the latest version of Magisk from GitHub and stream through Install β†’ Select Storage.
  • πŸ›‘οΈ Block the Recovery Updates: In MIUI Turn off automatic update checks in Settings β†’ The phone. β†’ Updating the system.

If you plan to install custom firmware (like LineageOS or Pixel Experience), first check their compatibility with your XDA model.Some firmware requires additional patches to work with Xiaomi-specific features like IR Blaster or Game Turbo.

⚠️ Note: After obtaining root rights through Magisk, some apps (such as banking or Netflix) may stop working. To hide root, use the MagiskHide Props Config module or Universal SafetyNet Fix module.

FAQ: Answers to Frequent Questions

Can I install TWRP on Xiaomi without unlocking the bootloader?
No, unlocking the bootloader is mandatory. Without it, the system will not allow you to flash the custom Recovery. The only exception is the temporary download of TWRP via fastboot boot twrp.img, but after the reboot the Recovery will disappear.
Why does the phone not boot after TWRP firmware?
Most likely causes: Incompatible version of TWRP (for example, for another model or version of MIUI); damaged boot partition (solved by firmware stock boot.img); Active Anti-Rollback (requires firmware for a newer version of MIUI before installing TWRP). Solution: run the stock firmware through the Mi Flash Tool and repeat the process with the correct version of TWRP.
How to upgrade TWRP to Xiaomi?
The update is done in the same way as the original installation: Download the new version of twrp.img. Reboot to TWRP. Select Advanced β†’ Flash Current TWRP (if available) or manually run through Install β†’ Install Image. Do not update TWRP via MIUI Updater - this will lead to a replacement with stock Recovery!
Can I remove TWRP and return stock recap?
Yes, for this: Download the stock firmware for your model from Xiaomi. Unpack the archive and find the recovery.img file. Sweat it through Fastboot: fastboot flash recovery.img After that, unlocking the bootloader will remain, but the recovery will be standard.
Will Google Pay work after installing TWRP and Magisk?
Probably not β€” Google Pay blocks devices with unlocked bootloader or root rights. To get around this limitation, install MagiskHide Props Config. In Magisk settings, activate MagiskHide. Reboot your device and check SafetyNet status through the SafetyNet Test app. If SafetyNet doesn't pass, try Universal SafetyNet Fix.