Installation of TWRP on Xiaomi: a complete guide with unlocking the bootloader and firmware

Installing custom TWRP on Xiaomi smartphones opens up more options: firmware for unofficial ROMs, backups through Nandroid, root rights, and even building backs after failed experiments. However, the process requires care β€” a mistake at any stage can turn a device into a useless brick. This instruction will take all the steps from unlocking the bootloader to final validation of TWRP.

It is important to understand that Xiaomi actively blocks the ability to install third-party recoveries on new models (for example, Redmi Note 12 or Xiaomi 14). Such devices may require bypassing protection through patches or alternative methods like FastbootD. We will consider a universal method suitable for most devices on Qualcomm Snapdragon (including POCO F5, Redmi K60), and also point out features for models on MediaTek (for example, Redmi 10C).

Before you start, answer three key questions:

  1. Are you ready to lose the warranty? (Unlocking the bootloader will cancel it)
  2. Is there a backup of important data? (The process erases everything from the device)
  3. Is your model suitable for TWRP installation? (check support on the official TWRP website)
πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 11/12
POCO F3/F4/F5
Xiaomi 12/13/14
Black Shark 5/6
Another model

Preparation of the device: unlocking the loader

The first and most critical step is unlocking the bootloader. Xiaomi blocks it by default, and without unlocking it is impossible to install TWRP. The process takes 3 to 30 days (depending on Xiaomi's policy) and requires you to link your Mi Account to the device.

First, check the status of the loader:

  1. Turn off your smartphone.
  2. Press Volume Down + Power to enter Fastboot.
  3. Connect the device to the PC and type the command: fastboot oem device-info
  4. If you see Device unlocked: false in the answer, the bootloader is blocked.

To unlock:

Link Mi Account to Settings β†’ Xiaomi Account

Enable OEM Unlock in Settings β†’ For developers

Enable USB debugging in the same settings

Install Mi Unlock Tool on PC

Download ADB and Fastboot

-->

Launch the Mi Unlock Tool, log in to the same account as your phone, and follow the instructions.Please note: the tool may require you to wait up to 720 hours (30 days) for new accounts.This timer is reset when you change your account or reset your device!

⚠️ If you see a "Couldn't unlock" error after waiting, try it: πŸ”„ Reconnect the device to another USB-port (preferably) USB 2.0). πŸ“± Reboot your phone in Fastboot again. πŸ–₯️ Run Mi Unlock Tool on behalf of the administrator.

2. Selecting a version of the TWRP for your model

Not all versions of TWRP are compatible with your device, and installing an inappropriate firmware will result in a bootloop or a complete loss of performance. Check your model support on the official website or on the XDA Developers forums.

For popular Xiaomi models, the current versions of TWRP (June 2026):

ModelCode nameThe latest version of TWRPFeatures
POCO F5marble3.7.0_12-0Android 14 support, Dynamic Partition support
Redmi Note 12 Pro+ruby3.7.0_11-0Requires a patch for anti-rollback
Xiaomi 13 Ultraisis3.7.0_9-0Unstable operation with FBE encryption
Black Shark 5 Problackshark5pro3.6.2_11-0Game Turbo Support Continues to Be Supported

For devices on MediaTek (e.g., Redmi) 10A or POCO M4 Pro) a special version may be required TWRP supportive MTK Bypass. download files only from trusted sources (e.g, XDA or Telegram-channels of developers).

πŸ’‘

If your model isn't officially supported, look for unofficial builds marked unofficial, but be prepared for bugs like a broken fingerprint sensor or a camera.

3. Install ADB and Fastboot on PC

TWRP requires the Android Debug Bridge (ADB) and Fastboot (Fastboot) tools, which can be installed in two ways:

  1. Minimum package: Download Google’s Platform Tools (~5MB) and unpack the C:\platform-tools drive root.
  2. Complete package: Install Android Studio – it includes all the necessary utilities.

After installation, add the path to the platform-tools to the PATH environment variable:

  1. Open Control Panel β†’ System β†’ Additional System Parameters β†’ Environment Variables
  2. In System Variables, find Path, click Edit, and add C:\platform-tools.
  3. Save the changes and restart the PC.

Check the performance by opening the command line and entering:

adb version


fastboot --version

If the teams output versions of utilities, everything is set up correctly.

4. TWRP firmware via Fastboot

Now, let's get to the installation itself. You're going to need a file. TWRP in.img format (e.g, twrp-3.7.0_12-0-marble.img for POCO F5). Place the downloaded file in the platform-tools folder.

Firmware instructions:

Turn off the phone and pinch Volume Down + Power to log in to Fastboot

Connect the device to the PC via USB

Open the command line in the folder with platform-tools

Enter the command fastboot flash recovery twrp-version.img

Reboot to Recovery with the Quickboot Reboot Recovery Team

-->

If you see a standard MIUI receiver after the reboot, it means that the firmware did not apply. This is a typical problem for devices with Dynamic Partition (for example, Redmi Note 11 and later).

  1. Download a special patch disable_dm-verity_forceencrypt.zip (like, from here).
  2. Sweat TWRP again, but after rebooting to the recovery, install the patch immediately via Install β†’ Select file β†’ Swipe to Confirm Flash.

⚠️ Note: Some models (e.g. Xiaomi) 12T) post-fix TWRP Anti-rollback protection, blocking device, may work. Before you run the firmware, check the current version of anti-rollback in Fastboot with the command: fastboot getvar anti and compare it to the requirements of the version. TWRP developer forum.

5. First start and set up TWRP

After successful firmware, you'll see the main TWRP menu with touch controls. The first thing you need to do is back up:

  • πŸ“ Select the Boot, Data, System (minimum).
  • πŸ’Ύ Please indicate the location of the save (better to USB-OTG microSD).
  • πŸ”„ Click Swipe to Back Up and wait until it’s finished.

If TWRP asks for a password (on encryption devices) FBE), But you didn't install it - try leaving the field empty or enter a standard one. PIN-lock screen code on some firmware (e.g, MIUI 14) format data may be required (wipes all data!):

  1. Go to Wipe β†’ Format Data.
  2. Enter yes to confirm.
  3. Reboot to TWRP again.
What if TWRP doesn’t see internal memory?
This is a typical problem for devices with Dynamic Partition and encryption. FBE. Solutions: 1. Connect USB-OTG flash-drive FAT32 β€” TWRP It will be seen as an external drive. 2. ADB Sideload for installation ZIP-file (adb sideload file.zip command). 3. Format the Data partition (erase all data!) if you are not afraid to lose files.

6. Removal of common errors

Even with the exact following of the instructions, there can be problems.

Mistake.Reason.Decision
Failed to mount /data (Invalid argument)FBE encryption or damaged partitionFormat Data in TWRP or disable_forceencrypt.zip
This package is for device: marble; this device is .The discrepancy between model and firmwareDownload the correct version of TWRP for your device code
Loaded loading (bootloop)Boot or Vendor damagedSweep the original boot.img through Fastboot or restore the backup
Fastboot unknown commandAn outdated version of FastbootUpdate Platform Tools to the latest version

If the TWRP device doesn't boot into the system after you install it, but the recovery is working, it's probably damaged the Boot partition.

  1. Download the original firmware for your model with Xiaomi Firmware Updater.
  2. Remove the boot.img file from the archive.
  3. Fastboot: fastboot flash boot.img

πŸ’‘

If TWRP is stitched but not running, check if it replaces the stock Recovery when booting. To do this, immediately reboot the Recovery with the fastboot reboot command, rather than the standard restart.

7. Additional features after installation

Now that TWRP has been successfully installed, you can:

  • πŸ”§ Install Magisk for root rights (download the latest version here and run through Install).
  • πŸ“¦ Switch custom firmware like LineageOS, Pixel Experience or ArrowOS.
  • πŸ”„ Create full system backups (Nandroid Backup) before experimenting.
  • 🧹 Clean Cache and Dalvik partitions to speed up the system.

To install custom firmware through TWRP:

  1. Download. ZIP-file and place it on the USB-OTG or internal memory.
  2. In TWRP, select Wipe β†’ Advanced Wipe and select Dalvik, Cache, System, Data.
  3. Return to the main menu, click Install, select a firmware file and confirm the installation.
  4. After you complete the process, you can use GApps (if you need Google services) and Magisk (if you need root).

⚠️ Note: On devices with Dynamic Partition (e.g. Xiaomi) 13 or Redmi Note 12) The standard Wipe method may not work. Instead, use the command to ADB: adb shell twrp wipe dynamic or run a special script dynamic_resize.zip before installing the firmware.

8. Stock firmware recovery

If you've had a TWRP experiment that's stopped working, you can always return the stock firmware.

  1. Download the official firmware for your model from the Xiaomi website (choose the Fastboot version).
  2. Unpack the archive in the platform-tools folder.
  3. Download the device to Fastboot (Loudness down + Power).
  4. Launch the file. flash_all.bat (for Windows or flash_all.sh (for Linux/Mac).

If the device is loaded into TWRP instead of the system after firmware, the recaveri has survived the reset.

  1. Download the original recovery.img from stock firmware.
  2. Fastboot: Fastboot Flash Recovery recovery.img
  3. Reset the device.

πŸ’‘

If the bootloader is blocked again after returning to the stock firmware, unlock it through the Mi Unlock Tool (the process will take only a few minutes, since the account is already tied).

FAQ: Frequent questions about installing TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
No, it's impossible. Xiaomi blocks entry to the recovery section on locked devices. Any "bypass" methods (like TWRP without unlock) are fraud or viruses. The only exception is a temporary TWRP via Fastboot boot twrp.img, but it will reset after the reboot.
Why does TWRP ask for a password I didn't set?
This is due to File-Based Encryption (FBE), default-on MIUI. TWRP trying to decipher the section /data, but he doesn't know yours PIN-Lock screen code. Solutions: Enter your standard PIN-If it doesn't work, format Data (erase all data!) for new devices (MIUI 14+) may require a patch disable_forceencrypt.
How to upgrade TWRP to a new version?
The TWRP update is done in the same way as the initial installation: Download a new.img file. Download to the current receptacle. Select Install β†’ Install Image and specify the path to the new file. Select Recovery and confirm firmware. Some versions of TWRP support an update via the TWRP App (installed as a regular application), but this method is less reliable.
Can I install TWRP on Xiaomi with a MediaTek processor?
Yes, but the process is more complicated because of the MTK Secure Boot protection. You will need: a special version of TWRP with MTK Bypass support; a utility SP Flash Tool or MTKClient; a scatter.txt file from stock firmware. For detailed instructions on XDA for your model (for example, for Redmi 9A or POCO M3).
What if the phone does not turn on after installing TWRP?
One of the most likely mistakes was: The wrong version of TWRP is to run the right one through the Fastboot. The Boot partition is damaged β€” restore it from the backup or run the original boot.img. Anti-Rollback is working β€” you need to firmware a newer version of MIUI. Conflict with Magisk β€” remove the modules before the firmware. If the phone doesn't respond at all (no vibration, no indicator lights), try to pinch Volume up + Power for 20-30 seconds for a forced reboot. If that doesn't work, contact the service center.