How to flash TWRP on Xiaomi: safe installation of custom recovery

Installing a custom TWRP on Xiaomi smartphones is the first step to full control of the device, which allows you to install unofficial firmware, backup the system, remove preinstalled applications and even restore bricks after unsuccessful experiments.

Unlike the standard Mi Recovery, TWRP (Team Win Recovery Project) provides advanced features including touch control support, ADB work and the ability to mount partitions manually. But before you start, it is important to understand that the firmware recovery on Xiaomi models with a locked bootloader is impossible – it must be unlocked officially through the Mi Unlock Tool. This step takes up to 720 hours of latency (according to Xiaomi rules of 2026) and requires a binding Mi Account.

In this guide, we will analyze the entire process from preparation to checking the health of TWRP, including nuances for popular models (Redmi Note 12 Pro+, POCO F5, Xiaomi 13T).

Firmware Preparation: What to Do Before Installing TWRP

Before you start firmware, make sure that all the prerequisites are met, and ignoring them is the main reason for the "bricking" of devices.

  • πŸ”“ Unlocked bootloader. Without this step, no further action is possible. Use the official Mi Unlock Tool (version at least 5.5.224.30 for Windows 11).
  • πŸ“± Battery charge β‰₯ 70% Firmware in a discharged state can be interrupted at a critical stage.
  • πŸ’» PC Windows/Linux. On macOS, there may be problems with drivers ADB/Fastboot.
  • πŸ”Œ Original. USB-Cheap cables often don't transmit data in Fastboot mode.
  • πŸ“ Backup data. Recovery firmware doesn't erase user files, but it's better to be safe.

Also check your device model through Settings β†’ About Phone β†’ Model. Some TWRP firmware is designed for specific modifications only. For example, the Redmi Note 11 Pro+ 5G (veux) and Redmi Note 11 Pro 5G (peux) require different recovery files.

⚠️ Note: If your device was purchased in China (the C-suffix version in the model, for example) 2201116TC), firmware TWRP It may result in a non-functioning module. NFC Use a recovery version marked CN.

Download the necessary files from verified sources:

  • πŸ”— Official website TWRP (Choose the latest stable version, avoid unofficial builds).
  • πŸ”— Platform Tools by Google (for the first time) ADB and Fastboot).
  • πŸ”— Stock firmware MIUI (in case of restoration).
πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 12/Pro
POCO F/X
Xiaomi 13/14
Redmi 10/9
Another model

Installation of drivers and configuration ADB/Fastboot

Without properly installed drivers, Windows will not recognize your device in Fastboot mode. Even if you have previously used ADB for debugging, additional drivers are required for firmware.

For Windows 10/11, follow the following steps:

  1. Connect your phone to your PC in Fastboot mode (turn off the device, then press Volume Down + Power until a bunny with the inscription FASTBOOT appears).
  2. Open Device Manager (Win + X β†’ Device Manager).
  3. Find a device with a yellow exclamation point (usually Android Bootloader Interface or Other devices β†’ Xiaomi...).
  4. Right-click β†’ Update the driver β†’ Search for drivers on this computer β†’ Select from the list.
  5. Install the driver manually by selecting Android Bootloader Interface from the list.

To check the performance of ADB/Fastboot:

  1. Open the command prompt in the folder with Platform Tools (click Shift + right mouse button β†’ Open the PowerShell window here).
  2. Enter the command: fastboot devices Should show the serial number of your device. If the list is empty, drivers are not installed.

⚠️ Note: On some laptops with USB 3.0 (blue ports) the device may not be defined in Fastboot. USB 2.0 (black) or hub.

Device is defined in fastboot devices|Drivers installed without errors|Battery charge β‰₯ 70%|File. TWRP scalable|Backup copy of data created-->

Step-by-step: firmware TWRP on Xiaomi

Now, to the core process, all commands are executed from the Platform Tools folder.

Step 1: Transfer the device to Fastboot mode

  1. Turn off your smartphone.
  2. Press the buttons Loudness down + Power for 10-15 seconds until the screen with a bunny and the inscription FASTBOOT appears.

Step 2. TWRP firmware

  1. Connect the device to the PC.
  2. In the command line, run fastboot flash recovery. twrp-3.7.0_12-veux.img (substitute twrp-3.7.0_12-veux.img in the name of your file).
  3. Wait for the message. OKAY [ 0.5s].

Step 3: Prohibit rewriting of the recaveri with stock firmware

By default, MIUI rewrites custom recaveri to standard when it first boots.

  1. Without disabling the device, execute the command: fastboot boot twrp-3.7.0_12-veux.img It'll temporarily load. TWRP memoryless.
  2. In the TWRP interface, go to Advanced β†’ Flash Current TWRP (if available).
  3. Or manually run the file. disable_forceencryption_treble.zip (Android-based 10+), to disable forced encryption.

Step 4: Reboot to TWRP

After a successful firmware:

  1. In the command line, do: fastboot reboot recovery
  2. The device must be loaded into the TWRP touch-controlled interface.
What to do if TWRP does not start?
If after the command fastboot reboot recovery device loads into the standard recovery Mi Recovery, then the stock firmware overwrote your TWRP. Decision: 1. Repeat the firmware. TWRP (step 2). 2. Immediately after the firmware, perform fastboot boot twrp.img (time-load). 3. V TWRP zip file with the recovery authentication disabled (for example, no_verity_opt_encrypt.zip). 4. Reboot to TWRP Once again, he must now remain permanently.

Common mistakes and their solutions

Even with the right instructions, there can be problems.

Mistake.Reason.Decision
FAILED (remote: 'Not allow in Lock State')The bootloader is not unlockedUnlock the bootloader through the Mi Unlock Tool (requires a wait of 720 hours for new accounts)
Invalid sparse file format at headerA TWRP file or incompatible version is damagedDownload another recovery file (check model matching) or use.img instead of.zip
The device hung on the Mi logoImproperly sewn boot or vendorDownload to Fastboot and flash the stock boot.img from the official firmware
TWRP does not see internal memoryEncryption FBE (File-Based Encryption)Please. disable_forceencryption_treble.zip or enter the password in TWRP (if you ask)

If the device does not turn on after TWRP firmware (black screen or freeze), try:

  • πŸ”Œ Hold the Loud up. + Power for 20 seconds for forced reboot.
  • πŸ–₯️ Connect to the PC and execute: fastboot flash boot boot.img (where boot.img β€” stock-file from official firmware).
  • πŸ“± If the screen is touch-sensitive, but nothing is displayed, maybe the display driver is damaged. USB-C (supported-model).

πŸ’‘

If TWRP doesn’t support your model, but you’re sure it’s compatible, try flashing it through the Official TWRP App from Google Play, which automatically picks up the correct version and prevents incompatible files from being bugged.

Additional TWRP settings after installation

After the first download to TWRP, it is recommended to perform several actions for stable operation:

  • πŸ”„ Backup. Go to Backup and select the Boot, System, Data, Vendor partitions. SD-card.
  • πŸ”§ Turn off authentication. At Mount, mark System, then Advanced. β†’ File Manager Delete Files: /system/bin/install-recovery.sh /system/etc/recovery.img
  • πŸ” Set up encryption. If you use a password, in Wipe. β†’ Format Data enter Yes to reset encryption (data will be deleted!).
  • πŸ“± Install Magisk (for root rights). Download the latest version Magisk.zip and run through Install.

For Android devices 12+ and dynamic partitions (dynamic_partitions) A special version may be required. TWRP supportive super.img. Check this in the Recovery settings: If the System partition doesn’t show up, your device uses dynamic partitions.

⚠️ Note: On some models (Xiaomi) 12/13, Redmi K50) Magisk firmware through TWRP This leads to a boot hover. In this case, use the patch method. boot.img via the official Magisk app.

Firmware custom firmware through TWRP

One of the main reasons for installing TWRP is the ability to install informal firmware such as LineageOS, Pixel Experience or crDroid.

Preparation:

  • Download firmware in.zip format (for example, lineage-20.0-20260510-veux.zip).
  • Check compatibility with your model (codename must match, for example veux for Redmi Note 12 Pro+ 5G).
  • Download the appropriate GApps package (if the firmware is not Google services), for example NikGApps-basic-arm64-20-20260515.zip.

Firmware process:

  1. Reboot to TWRP (adb reboot recovery or buttons).
  2. Run Wipe β†’ Advanced Wipe and mark: Dalvik / ART Cache System Data Cache
  3. Select Zip through Install β†’ Select Zip.
  4. Immediately after the firmware, install GApps (if necessary) and Magisk (for root rights).
  5. Reboot β†’ System: The first boot can take 10-15 minutes.

If after the firmware custom firmware device does not load:

  • πŸ”„ Come back in TWRP Check the logs (advanced) β†’ Copy Log).
  • πŸ“± Try to sew another core (boot.img) stock-stack.
  • πŸ”§ Make sure the firmware supports your version. MIUI (For example, firmware based on Android 13 is incompatible with Android 14).

πŸ’‘

Always check custom firmware reviews on the XDA Developers or 4PDA forums. Some builds may have critical bugs, such as broken Wi-Fi or Bluetooth.

Recovery of MIUI stock firmware

If you have decided to return to the original MIUI after experimenting with TWRP or custom firmware, follow this instruction:

Method 1: Fastboot (recommended)

  1. Download Fastboot firmware for your model from the official Xiaomi website (file with the extension.tgz or.zip).
  2. Unpack the archive in a folder with Platform Tools.
  3. Transfer the device to Fastboot (Loudness down + Power).
  4. Launch the file. flash_all.bat (For Windows, or execute manual commands: fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash system system.img fastboot flash vendor vendor.img fastboot erase userdata fastboot reboot

Method 2: Through TWRP

If you have a working TWRP:

  1. Download Recovery firmware (.zip) for your model.
  2. Move the file to the device or SD-map.
  3. In TWRP, select Install β†’ Select Zip and swipe the file.
  4. Run Wipe β†’ Format Data (required!), then reboot.

⚠️ Note: When you return to stock firmware via Fastboot, all data will be deleted, including files in internal memory. If you want to save photos or documents, retrieve them through the Fastboot. TWRP (Mount β†’ Enable MTP) before-fixing.

FAQ: Frequent questions about the firmware TWRP on Xiaomi

Can I flash TWRP without unlocking the bootloader?
No. All modern Xiaomi devices (starting in 2018) require official unlocking via the Mi Unlock Tool. bypasses (e.g., via EDL vulnerabilities) work only on older models (Redmi 4X, Mi A1) and can lead to hard-brick (irreparable damage).
Why does the phone not turn on after TWRP firmware?
There are several reasons: incompatible version TWRP (Download the file for your model. Damaged boot section (sweep stock) boot.img). Conflict with encryption (please request) disable_forceencryption_treble.zip). Solution: boot into Fastboot and flash the stock firmware through the Mi Flash Tool.
How to upgrade TWRP to a new version?
The update is done in the same way as the original firmware: Download a new.img file. Reboot to Fastboot. Run: fastboot flash recovery twrp-new.img Reboot to Recovery: fastboot boot twrp-new.img The TWRP itself also has an update feature via Advanced β†’ Install Recovery Ramdisk.
Can I flash TWRP on Xiaomi with a MediaTek processor?
Yes, but the process is more complicated because of the closed MediaTek architecture. You will need to: Unlock the bootloader (the procedure is the same, but some Redmi models on the MTK require additional permission from Xiaomi). Use special versions of the TWRP with support for MTK (for example, for the Redmi Note 11 on the Helio G88). Switch through the SP Flash Tool instead of the Fastboot (for older models). On new devices (Redmi 12C, POCO C50), the firmware through the Fastboot works as standard.
How to remove TWRP and return to the drainage Recovery?
To remove TWRP: Download the official reclaimer for your model (usually part of the Fastboot firmware). Sweat it through Fastboot: fastboot flash recovery.img or run the full stock firmware through the Mi Flash Tool (Clean All option). Note that once you return to the drain recavereator, you will lose access to advanced features, but the device will return to the "out of the box" state.