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

Installing custom TWRP on Xiaomi smartphones provides access to advanced features: firmware unofficial ROM, creating full system backups, root rights and even restore bricks. However, the process requires accuracy – an error at any stage can lead to a loss of warranty or complete failure of the device. In this guide, we will analyze all the steps from unlocking the bootloader to checking the health of the TWRP, taking into account the features of the latest versions of MIUI and Redmi/POCO models from 2023-2026.

It is important to understand that Xiaomi actively blocks unofficial backups through the anti-rollback mechanism and verification of the bootloader signature. TWRP The official website is twrp.me, for example, for Xiaomi. 13 Pro or Redmi Note 12 Pro+ Special assemblies with support for dynamic partitions may be required (dynamic_partitions).

1. Preparation: What to do before installing TWRP

Before you start unlocking and firmware, gather everything you need, and without proper preparation, you risk getting a brick or losing data.

  • πŸ“± Xiaomi smartphone with battery charge β‰₯ 70% Qualcomm Snapdragon processors (e.g., Qualcomm Snapdragon, POCO F5 or Redmi K60) Supported better than MediaTek devices (e.g. Redmi Note 11 Pro).
  • πŸ–₯️ Computer running Windows 10/11 Linux (MacOS may require additional drivers).
  • πŸ”Œ USB-original or high quality cables (cheap cables often cause firmware errors).
  • πŸ”“ Mi Account with a linked phone number (to unlock the bootloader).
  • πŸ“‚ Data backup: contacts, photos, messages (TWRP It doesn’t erase data, but unlocking the bootloader is a yes).

Also check the MIUI version in settings (Settings β†’ About Phone β†’ MIUI version). Devices on MIUI 14 and later may need to roll back to older firmware before unlocking the bootloader. For example, Xiaomi 12T on MIUI 14.0.5 sometimes refuses to unlock without a downgrade to MIUI 13.

πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 12/13
POCO F/X
Xiaomi 13/14
Redmi K60/K70
Another model

2 Unlock the bootloader: the official way from Xiaomi

Xiaomi blocks the bootloader on all devices, so it must be unlocked through the official Mi Unlock Tool.The process takes 7 to 30 days (depending on Xiaomi's policy at the time of reading).

  1. Download the Mi Unlock Tool from the official website. Use only the latest version - the old ones may not support new models.
  2. Enable the developer mode on your smartphone: go to Settings β†’ About the phone and 7 times click on the version MIUI. Then go back to Settings. β†’ Additionally. β†’ For developers and activate: πŸ”§ Debugging by USB πŸ”“ Unlocking OEM (point!)

Connect the smartphone to the PC, confirm the debugging permission on the phone screen.

Launch the Mi Unlock Tool, log in to your Mi Account (should match your phone account!). Follow the program instructions.

Once you send an unlock request, Xiaomi will link your device to your account. Usually you need to wait 168 hours (7 days), but sometimes the period increases to 30 days.

πŸ’‘

If the Mi Unlock Tool gives you a β€œCouldn’t unlock” error after waiting, try using the developer version of the tool (e.g., the β€œCouldn’t unlock” version, miflash_unlock-en-6.5.224.24) or connect to the PC through USB-Hub – This sometimes solves driver problems.

3.Selecting the Right TWRP Version for Your Model

Not every version of TWRP is right for your device, and using the wrong build can result in a soft brick (the device turns on but doesn’t load) or a hard brick (completely inoperable).

Check compatibility on the official website twrp.me/Devices.

  • πŸ“± Xiaomi 13 Ultra β†’ twrp-3.7.0_12-v7.0_A13-sagit.img (supportive dynamic_partitions)
  • πŸ“± Redmi Note 12 Pro+ β†’ twrp-3.7.0_12-20231014-redwood.img
  • πŸ“± POCO F5 β†’ twrp-3.7.0_12-0-mondrian.img

For devices with A/B partitions (such as Xiaomi 12T or POCO X5 Pro), you need to flash TWRP on both slots ( a and b).

Xiaomi modelCode nameType of separationFeatures of TWRP
Xiaomi 13 PronuwaDynamic PartitionsTWRP with super.img support is required
Redmi Note 12 Pro+redwoodA/B (slot)Switch on both slots
POCO F4 GTingresA-onlyStandard firmware
Xiaomi 11T ProviliA/BPossible problems with encryption
How to find out the code name of your Xiaomi?
Open the Phone app and enter the code ##4636##. In the Phone Information menu, find the line "Device model" - this is the code name (for example, suryah for the Redmi Note 10 Pro).

4. Install TWRP via Fastboot

The most reliable way to flash TWRP is through Fastboot mode, which requires ADB and Fastboot tools that can be downloaded from the Android Developers website.

Step-by-step:

  1. Unpack the archive from the platform-tools to the root of the C:\ disk (e.g., C:\platform-tools\).
  2. Place the twrp-*.img file in the same folder.
  3. Open the command prompt in this folder (click Shift + right mouse button β†’ β€œOpen PowerShell window here”).
  4. Turn off your smartphone and press Volume Down + Power to log into the Fastboot.
  5. Connect the device to your PC and check the connection with the command: fastboot devices should show the serial number of your phone.
  6. Please. TWRP Team: Fastboot Flash Recovery twrp-3.7.0_12-0-redwood.img Replace the file name with yours.
  7. For devices with A/B Execute the following: fastboot flash recovery_a twrp-*.img fastboot flash recovery_b twrp-*.img
  8. Reboot to Recovery: fastboot boot twrp-*.img

β˜‘οΈ Firmware preparation TWRP

Done: 0 / 5

If you load your phone into a stock recave after you run TWRP, MIUI has overwritten it.

  1. I'm going to run TWRP again through Fastboot.
  2. Download immediately to TWRP (fastboot boot twrp.img).
  3. In TWRP, go to Advanced β†’ Flash Current TWRP (if there is one).

πŸ’‘

On devices with MIUI 14+, after the firmware TWRP, you must immediately disable the bootloader signature verification, otherwise the system will overwrite the Recovery at the first boot.

5. Solving common mistakes

When installing TWRP, users often encounter problems, and here are the most common ways to solve them:

  • ❌ Failed to boot into recovery error Reason: Wrong version TWRP Solution: Check version compatibility TWRP and re-unlock the loader.
  • ❌ Device not defined in Fastboot Reason: Problems with drivers or USB-Solution: Install the Mi Flash Tool drivers and try another cable.
  • ❌ TWRP It is applied but replaced with a stock cause: MIUI Solution: After the firmware, load into the back-end. TWRP and disable signature verification (if there is such a clause in the settings).
  • ❌ Error "Invalid sparse file format at header" Cause: Damaged file TWRP. Solution: Download the image again and check the checksum MD5.

⚠️ Attention: If after installation TWRP phone stopped turning on (black screen, flashing backlight), don't panic. Try booting up to Fastboot. + Power) and flash the stock firmware through the Mi Flash Tool, which restores performance in 90% of cases.

6.The first steps in TWRP: backup and settings

Once you have successfully installed TWRP, the first thing you do is create a complete backup system, which will save your data in case of errors in further manipulation.

How to make a backup in TWRP:

  1. In the main menu, select Backup.
  2. Mark the sections: Boot, System, Data, Vendor (for devices with dynamic_partitions Choose Super).
  3. Press Select Storage and select the location of the save (internal memory or microSD).
  4. Swipe to start the backup.

It is also recommended that:

  • πŸ”’ Set a password for TWRP (Settings β†’ Set Screen Lock).
  • πŸ“± Disable Signature Verification (Settings) β†’ Enable MTP file transfer).
  • πŸ”„ Enable backup compression (Settings) β†’ Use Compression).

If you plan to get root rights, download the latest version of Magisk (Magisk-v26.4.zip) and run it through Install β†’ Select Zip in TWRP.

⚠️ Note: On some models (Xiaomi) 12S Ultra, Redmi K50 Gaming) Magisk firmware may cause a download failure due to DM-Verity protection. disable_dm-verity_forceencrypt.zip.

7.TWRP Update and Return to Stock Recavator

Over time, new versions of TWRP with bug fixes and support for fresh firmware are released.

  1. Download the new.img file TWRP.
  2. In TWRP, select Advanced β†’ Install Recovery Ramdisk.
  3. Specify the path to the downloaded file and confirm the installation.

If you need to return stock recavators (for example, for warranty repair), download the official firmware for your model from the Xiaomi Firmware website and thread it through the Mi Flash Tool with the clean all option.

For devices with an unlocked bootloader, you can also return stock recavators via Fastboot:

fastboot flash recovery recovery_stock.img


fastboot reboot

FAQ: Frequent questions about installing TWRP on Xiaomi

❓ Can we determine TWRP loader-free?
No, Xiaomi blocks the unofficial backups at the boot level. Without unlocking through the Mi Unlock Tool, TWRP installation is impossible. The only exception is the temporary download of TWRP through the fastboot boot command, but after the reboot it will disappear.
❓ Why after the firmware? TWRP phone out?
Probable causes: Wrong TWRP version for your model, damaged image file, conflict with MIUI version (e.g., TWRP firmware for MIUI 13 on MIUI 14) Solution: run the stock firmware through the Mi Flash Tool and repeat the process with the correct version of TWRP.
❓ How to avoid the error "This package is for... models only" TWRP?
This error occurs when trying to make ZIP-File (such as Magisk or custom firmware) not intended for your model. ZIP-file with your device (code name) Archive integrity (download again) There are gaps in the file name (sometimes this causes an error).
❓ Can I get root rights without TWRP?
Yes, with Magisk in patch boot mode: Download stock boot.img Open it in Magisk (Install) β†’ Select and Patch a File. boot.img Fastboot: Fastboot Flash boot magisk_patched.img However, this method does not allow you to create backups or sew custom ZIP-file.
❓ What to do if after installation TWRP I can't see the internal memory?
This is a common problem on encryption devices. FBE (File-Based Encryption Solutions: Enter the lock password in TWRP (If you ask, please. disable_forceencrypt.zip (It turns off the forced encryption. Use it. OTG-flash-drive.