How to install TWRP on Xiaomi: unlock the bootloader + firmware recovery

Installing custom TWRP on Xiaomi smartphones gives you access to advanced features: backups via Nandroid, firmware custom ROM (for example, LineageOS or Pixel Experience), root rights via Magisk, as well as the ability to β€œreanimate” the device after a failed update. However, the process requires care: an error in the unlocking stage of the bootloader or firmware can turn the phone into a β€œbrick”.

Unlike Samsung or Google Pixel devices, where it is enough to turn on OEM Unlock, Xiaomi will have to go through the official procedure of unlocking through the Mi Account and wait 7-14 on new models (on new models) 2023-2026 before 360 Also, not all versions TWRP compatible with the latest firmware HyperOS - we will talk about this in the section about the choice of the file Recaveri.

This instruction will be suitable for most Xiaomi/Redmi/POCO devices based on Qualcomm Snapdragon processors (Mi 10/11/12/13 series, Redmi Note 10/11/12, POCO F3/F4/F5, etc.). Owners of MediaTek devices (for example, Redmi 10C or POCO M5) will need an alternative method through the SP Flash Tool – we briefly discuss this in the FAQ.

Before you start, check:

  • πŸ”‹ Battery charge of at least 60% (when discharged during firmware, the phone may turn off).
  • πŸ“± There is a scaling device on the device. MIUI (custom ROM They can block the unlocking).
  • πŸ’» There is access to a Windows PC 10/11 Linux (MacOS will require additional drivers).
πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 12/13
POCO F4/F5
Mi 11/12/13
Another model
I haven't decided yet.

1.Preparation: Unlocking the bootloader on Xiaomi

The bootloader on all Xiaomi devices is locked by default, and unlocking it is a mandatory step before installing TWRP. The process consists of two steps: linking the Mi Account account to the device and sending a request to unlock through the Mi Unlock Tool utility.

⚠️ Attention: On Xiaomi models 13/13T/14 Redmi Note 12 Turbo with HyperOS unlock waiting time extended to 15 day-day (360 For older devices (up to hours). 2022 year enough 7 days.

Instructions for unlocking:

  1. Activate Developer Mode: Go to Settings β†’ About Phone β†’ MIUI Version and tap it 7 times.
  2. Back to Settings β†’ Additionally. β†’ For developers and include: πŸ”“ Unlocking OEM (may be called OEM Unlocking). πŸ”Œ Debugging by USB (USB Debugging).

Mi Account

Settings β†’ Xiaomi Account β†’ Data Synchronization

Mi Unlock Tool

Xiaomi USB Drivers

Fastboot

Loudness down + Nutrition

Mi Unlock Tool

Mi

"Wait 168 hours"

πŸ’‘

If the Mi Unlock Tool gives you a "Couldn't unlock" error, try using the 3.5.511.21 version of the utility, which is often more stable than new releases.

2.Selecting the right version of TWRP for your model

The error in choosing a TWRP file is the most common reason for devices to β€œbrick” because even for one model (for example, Redmi Note 11 Pro+) there can be different versions of the recovery for different regions (Global, China, India) and firmware types (MIUI vs HyperOS).

Where to download TWRP:

  • 🌐 Official website: twrp.me – look for your model in the Devices list.
  • πŸ“₯ Telegram channels: @XiaomiTWRP or @TWRP_updates (Relevant assemblies for new devices).
  • πŸ”§ Forums: XDA Developers (partitions by specific models, for example, Redmi Note 12).

How to check compatibility:

  1. Find out the code name of your device: Enter the command in the ADB terminal: adb shell getprop ro.product.device Or look at Settings β†’ About Phone β†’ Model (for example, vili for Xiaomi 11T Pro).

TWRP

twrp-3.7.0_12-vili.img

HyperOS

hyperos-compatible

android-14

Xiaomi modelCode nameCompatible version of TWRPNotes
Xiaomi 13 Pronuwatwrp-3.7.0_12-nuwa.imgRequires to disable avb2.0 in fastboot
Redmi Note 12 Pro+rubytwrp-3.7.0_12-ruby-HyperOS.imgSupports HyperOS 1.0+
POCO F4munchtwrp-3.6.2_12-munch.imgIt does not work with MIUI 14.0.6+.
Xiaomi 12Tplatotwrp-3.7.0_12-plato.imgA patch is required for dm-verity
What if there is no TWRP for your model?
If there is no official TWRP build for your device, try: 1. A port with a similar model (for example, the Note 11 Pro 4G version will suit the Redmi Note 12 4G version), 2. A build from third-party developers (look for 4PDA or XDA for "unofficial twrp [model]"). 3. OrangeFox Recovery is an alternative to TWRP with MIUI OTA support (website: orangefox.download). Risk: Unofficial builds may not support data backups or touch interfaces.

3. Install TWRP via Fastboot (Step-by-step)

When the bootloader is unlocked and the TWRP file is downloaded, we start the firmware. We use Fastboot mode, because installing it through ADB Sideload on Xiaomi often causes crashes.

Tools required:

  • πŸ–₯️ PC with installation ADB and Fastboot.
  • πŸ“ Twrp file-[version]-[codename].img (rename it in the form of a twrp.img convenienceally).
  • πŸ”Œ Cable USB Type-C (preferably original to avoid communication breakdowns).

Instructions:

  1. Turn off the phone and put it in Fastboot mode (clip Volume Down + Power).
  2. Connect the device to your PC and check the connection with the command: fastboot devices must display the serial number of the phone.
  3. Squeeze TWRP temporarily (without writing in the recovery section): fastboot boot twrp.img This step is critical: it allows you to test the work of the Recovery without the risk of damaging the stock.
  4. If the TWRP booted successfully (a logo with a command menu will appear), go back to Fastboot and flash it constantly: fastboot flash recovery twrp.img
  5. For devices with HyperOS, additionally do: fastboot flash recovery_ab twrp.img (This is true for models with a section recovery_ab, for example, Xiaomi 13).

βœ… File. TWRP renamed twrp.img And it's in the fastboot folder.

βœ… Phone in Fastboot mode (screen with a rabbit)

βœ… Xiaomi drivers installed (there are no exclamation points in the device manager)

βœ… Battery charge > 60%

βœ… Backup copy of data created (TWRP erases data at the first launch!)

-->

4.The first launch of TWRP: setup and backup

Once a TWRP firmware is successful, you need to configure it correctly, otherwise the stock firmware may overwrite the Recovery when it first boots, and it’s also important to create a Nandroid backup immediately so you can roll back to the working version of the system.

Actions after installation:

  1. Boot into TWRP: Turn off the phone, then press Volume Up + Power.
  2. If you request permission to modify, swipe to allow modifications.
  3. Go to Wipe β†’ Format Data, enter yes and confirm. This will delete all data from the device!
  4. Go back to the main menu and create a backup: πŸ“ Choose Backup. πŸ”˜ Mark the sections: Boot, System, Data, Vendor. πŸ’Ύ Specify the location of the save (preferably on microSD or OTG-accumulator). πŸ”„ Start the process. 10-20 minute).

⚠️ Warning: On HyperOS devices, stock firmware can automatically restore the original Recovery to avoid this:

  • After creating a backup, immediately swipe Magisk (if you need a root) or a patch for dm-verity.
  • Turn off signature verification in TWRP: Mount β†’ Disable Forced Encryption.

5. Problem Solving: Errors and Bricks

Even if you follow the instructions accurately, you can get errors, and let's look at the typical scenarios and how to fix them.

Error 1: Fastboot: Unknown Command

  • πŸ”Ή Make sure that the fastboot folder is added to the variable PATH (or run commands from this folder).
  • πŸ”Ή Check that file name TWRP written without spaces and Cyrillic (for example, twrp.img, Not twrp for Xiaomi.img).

Error 2: The phone is not loading (bootloop)

  • πŸ”„ Try to boot up in. TWRP and restore the backup (Restore).
  • πŸ”§ If there is no backup, run the stock firmware through the Mi Flash Tool (download Fastboot). ROM for your model on the official website).
  • πŸ”Œ For anti-rollback devices (e.g., Xiaomi) 12S Ultra) use the firmware of the same or newer version that was installed earlier.

Error 3: TWRP doesn't see internal memory

  • πŸ” It's about encryption. FBE (File-Based Encryption. Solution: In TWRP Go to Wipe. β†’ Format Data (erases all data!) or plug in OTG-backup.