Installation of TWRP on Xiaomi: unlocking the bootloader and firmware recaveri

Why to Install TWRP on Xiaomi

TWRP (TeamWin Recovery Project) is a powerful tool for Xiaomi smartphone owners that allows you to access advanced features of the system. It can install informal firmware, create full backups, restore data and even bypass some of the limitations of MIUI. However, the installation process requires preparation: from unlocking the bootloader to choosing the right version of the.img file for your model.

Unlike the standard Mi Recovery, which offers a minimal set of options (reset to factory settings, check for updates), TWRP provides full control over the partitions of the device’s memory. This is especially true for users who want to flash the Custom ROM (like LineageOS or Pixel Experience), get root rights through Magisk, or simply have a backup before experimenting. But it’s important to understand that installing TWRP voids Xiaomi’s warranty and can lead to locking the device if errors occur.

This guide is suitable for most modern Xiaomi, Redmi and POCO models (from Redmi Note 7 to Xiaomi 14 flagships). However, the process may be different for devices based on MediaTek processors (for example, Redmi 9 or POCO M3) – they will require additional drivers and utilities. If you are a beginner, we recommend first to study the theory: what a bootloader is, what distinguishes fastboot from recovery, and why you can not install TWRP on devices with a locked bootloader.

Preparation: What to do before installing TWRP

Before you start firmware, make sure your device is ready for the procedure. The first and most important thing is to unlock the bootloader. Without this step, installing TWRP is impossible. Xiaomi officially allows you to unlock the bootloader through the Mi Unlock service, but the process can take up to 72 hours (due to the company's security policy).

  • πŸ“± Xiaomi smartphone with a battery charge of at least 60% (to avoid disconnection during firmware).
  • πŸ’» Computer running Windows 10/11 (for Mac/Linux Additional adjustments will be required ADB).
  • πŸ”Œ Original. USB-cable (cheap cables can cause errors in data transmission).
  • πŸ”“ Mi Account tied to the device (required to unlock the bootloader).
  • πŸ“ Backup of data (installation) TWRP will cause the device to reset).

Also download the necessary tools:

  • πŸ› οΈ Platform Tools (contains fastboot and adb).
  • πŸ”— Mi Unlock Tool (official utility for unlocking the bootloader).
  • πŸ“¦ File. TWRP For your model (download only from the official website) TWRP or verified sources, for example, XDA Developers).

⚠️ Note: Some Xiaomi models (e.g. Redmi Note 10 Pro) POCO X3 Pro) have Anti-Rollback protection, install outdated version TWRP On such devices can lead to hard brick (unable to recover without service equipment).Always check the compatibility of the version of the recovery with your firmware!

πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 12/Pro
POCO F5/X5
Xiaomi 13/14
Redmi 10/9
Another model

Step 1: Unlock the bootloader through Mi Unlock

Unlocking the bootloader is a must-have without which it is impossible to flash TWRP. Xiaomi has made this process more difficult in the latest versions of MIUI, so follow the instructions carefully:

  1. Activate Developer Mode: Go to Settings β†’ About Phone β†’ MIUI Version and tap it 7 times until a notification appears You became a developer.
  2. Enable USB debugging and OEM unlocking: Return to Settings β†’ Additional β†’ Developer and activate: USB Debugging OEM unlock (may be absent on some models).

Link your Mi Account to your device:

Go to Settings β†’ Xiaomi Account β†’ Mi Cloud and make sure that the device is tied to the account. Without this, the Mi Unlock Tool will not work.

Now connect your smartphone to your computer and start the Mi Unlock Tool:

  1. Sign in to the utility under the same Mi Account as on your phone.
  2. Press Unlock and follow the instructions. The utility can request confirmation via SMS or email.
  3. On new devices (Xiaomi 12/13, Redmi Note 11/12), unlocking takes 72 hours (this is a Xiaomi limitation, you can’t get around it).

⚠️ Warning: If the device doesn't boot after unlocking (hangs on the Mi logo), don't panic. That's OK, just run the official firmware through the Mi Flash Tool and repeat the process. But remember, you can only lock the bootloader again after 30 days!

Mi Account is tied to the device|Debugging by USB included|The device is more charged. 60%|Drivers installed ADB/Fastboot|Downloaded official firmware in case of failure-->

Step 2: Install ADB and Fastboot drivers

To communicate with the device through the computer, you need ADB (Android Debug Bridge) and Fastboot drivers. Without them, commands will not be executed, and the device will not be determined in firmware mode.

If you downloaded Platform Tools (see Preparation section), unpack the archive to the root of the disk. C:\ (for example, C:\platform-tools\). Then:

  1. Connect your phone to your computer in Fastboot mode (turn off the device, then press Volume Down + Power until the Fastboot bunny appears).
  2. Open Device Manager (Win + X β†’ Device Manager) and find a device with a yellow exclamation point (usually Android Bootloader Interface or Other devices).
  3. Right-click on it β†’ Update the driver β†’ Search on this computer β†’ Select from the list β†’ Install from the disk.
  4. Point the way to the file. android_winusb.inf in the platform-tools folder (for example, C:\platform-tools\extras\google\usb_driver\).

After installing the drivers, check the connection:

fastboot devices

If you see the serial number of the device (for example, 1234abcd fastboot) in response, the drivers are installed correctly.

πŸ’‘

If the fastboot device command doesn’t show the device, try changing it. USB-Also check if the connection is blocked by antivirus (for example, Avast or Kaspersky often interfere with the work). ADB).

Step 3: Firmware TWRP via Fastboot

When the bootloader is unlocked and the drivers are installed, you can start the TWRP firmware. Importantly, only use the version of the backpack that is designed for your model and the MIUI version. For example, the Redmi Note 11 Pro+ 5G (veux) and Xiaomi 12T Pro (diting) require different.img files.

Firmware instructions:

  1. Download the file. twrp-3.7.0_12-0-?ux.img (Replace the Veux with your model code and place it in the platform-tools folder.
  2. Move the device to Fastboot mode (as described above).
  3. Open the command line in the platform-tools folder (click Shift). + right-button β†’ Open the PowerShell window here and execute the command: fastboot flash recovery twrp-3.7.0_12-0-?ux.img
  4. After successful firmware, execute: fastboot boot twrp-3.7.0_12-0-?ux.img It'll temporarily load. TWRP, avoid overwriting standard recaverys at the first load.

If it goes well, you’ll see a touch-controlled TWRP menu, but on some devices (like the POCO F4 GT or Xiaomi 12S Ultra), you may need to take the additional step of disabling the firmware signature check:

fastboot flash vbmeta vbmeta.img


fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

⚠️ Note: On devices with dynamic partitions (e.g. Xiaomi) 11T Pro or Redmi K50) firmware TWRP It might not work, but it would require a special version of the Recaveri that supports it. dynamic_partitions (look XDA or in thematic chat rooms).

What happens if TWRP doesn’t start?
If after firmware the device is loaded into the standard Mi Recovery recovery, then the system overwrote TWRP. Decision: 1. Repeat the command fastboot boot twrp.img (time-load). 2. On the menu. TWRP Go to Advanced. β†’ Flash Current TWRP (if the option is available). 3. Please. disable_dm-verity_forceencrypt.zip (if you want to disable encryption). 4. Reboot to TWRP Adb Reboot Recovery Command.

Step 4: Continuously installing TWRP and preventing overwriting

Many users face a problem: after the firmware TWRP It disappears when you first boot it into the system. MIUI It automatically restores the standard Recovery. TWRP, needle:

  1. Immediately after the temporary download to TWRP (fastboot boot), go to the Mount section and make sure that the System tick is marked.
  2. Download the file. disable_dm-verity_forceencrypt.zip Then, put it on the device (through the device). ADB push SD-map).
  3. In TWRP, click Install, select the downloaded file, and swipe for firmware. This will disable system integrity verification and data encryption, allowing TWRP to remain on the device.
  4. Reboot to the recaveri (not the system!). Now the TWRP must stay in place.

For devices with A/B-partitions (e.g. Xiaomi) 12, POCO F4) It's a little more complicated. You're gonna need to sew it up. TWRP on both slots ( a and b):

fastboot flash recovery_a twrp.img


fastboot flash recovery_b twrp.img

Xiaomi modelType of sectionAdditional action
Redmi Note 10 Pro (sweet)Normal.Sweep disable_dm-verity
Xiaomi 11T Pro (vili)DynamicUse it. TWRP supportive dynamic_partitions
POCO X3 NFC (surya)A/BSwitch on both slots (recovery_a and recovery_b)
Redmi 9 (lancelot)Normal.Disable AVB 2.0 via vbmeta

πŸ’‘

On devices with MIUI 13+ and later, you may need to disable MIUI Optimization in the developer settings (Settings β†’ Developer β†’ MIUI Optimization) otherwise the system will restore the standard recovery with each reboot.

Step 5: Backup and Restore in TWRP

One of the main advantages of TWRP is the ability to create full backups of the system (Nandroid backup), which will save your data in the event of a failed firmware or experimentation with root.

  1. In the TWRP menu, select Backup.
  2. Mark the backup sections (it is recommended to choose Boot, System, Data, Vendor).
  3. Select a storage location (internal memory or storage). SD-map).
  4. Swipe to start the process. Backup can take 10 to 30 minutes depending on the amount of data.

For recovery:

  1. In the TWRP menu, select Restore.
  2. Specify the folder with the backup and select the desired sections.
  3. Confirm swipe recovery.

Important: backups made in TWRP are not compatible with backups from Mi Cloud or standard recovery, and it is not recommended to restore backups to other device models, this will lead to a bootloop ( loop reboot).

πŸ’‘

If you plan to flash Custom ROM, first make a backup of the persist partition (responsible for IMEI and modem data).

Common mistakes and their solutions

Even with the correct following of the instructions, errors can occur, and here are the most common problems and ways to solve them:

  • 🚨 fastboot: error: cannot load 'twrp.img': img file is corrupted or not found. Make sure the file is in the same folder as fastboot.exe and its name is correctly listed (with extension).
  • πŸ”„ The device is loaded into Mi Recovery instead of TWRP: The system overrecorded the recaveri. disable_dm-verity (see Step 4) Or use the command fastboot boot twrp.img temporary.
  • πŸ“΅ Device not turned on after firmware (hard brick): This may happen due to incompatible version TWRP Solution: Flip the official firmware through the Mi Flash Tool in mode EDL (You need an authorized Xiaomi account).

If your Xiaomi model is equipped with a MediaTek processor (e.g. Redmi) 9A or POCO C31), firmware TWRP need:

  • Install MediaTek Preloader drivers.
  • Use the SP Flash Tool instead of fastboot.
  • Disable SLA protection (on some models).
How to enter EDL (Emergency Download Mode) mode?
Regime. EDL You need to restore the device after a hard brick: 1. Turn off the phone. 2. Hold the Loud up. + Loud down and plug in. USB-computer-wire. 3. Hold the buttons. 10–15 seconds until the screen goes out (some models will have an inscription on them). EDL). 4. In Mi Flash Tool, select the mode flash_all_lock.bat complete recovery. ⚠️ Attention: misuse EDL It can permanently damage the device!

FAQ: Frequent questions about installing TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
No. Xiaomi blocks entry to the recovery section on locked devices. Any attempts to circumvent this restriction lead to the error fastboot: error: Command not allowed. The only exception is the temporary download of TWRP through fastboot boot, but this will not give permanent access.
Why does the phone ask for a password when downloading after installing TWRP?
This is due to the enabled data encryption (FBE β€” File-Based Encryption Solutions: Please disable_dm-verity_forceencrypt.zip into TWRP. Make a complete reset (Wipe) β†’ Format Data, enter yes. Use TWRP supportive FBE (For example, the version from OrangeFox).
How to check if TWRP is successfully installed?
Reboot the device to the recavator (Loudness up + Power). If you see a menu with touch control and the TeamWin logo, it went well. You can also run a command: fastboot getvar current-slot and check that the recovery section is not overwritten.
Can I upgrade TWRP without re-unlocking the bootloader?
If the bootloader is already unlocked, you can update the TWRP directly from the current version of the recovery: Download a new.img file. In TWRP, select Install β†’ Install Image. Specify the path to the file and select the Recovery section. Swipe for firmware.
Which Xiaomi models do not support TWRP?
At the moment, there is no official TWRP support for the following devices: Xiaomi 13 Ultra (due to the complex partition scheme); Redmi Note 12 Turbo (new models on Snapdragon 7+ Gen 2); POCO F5 Pro (unofficial builds are required); HyperOS devices (new firmware from Xiaomi, Released in 2026); for these models, the alternative is OrangeFox Recovery or Pitch Black Recovery.