How to Install TWRP Recovery on Xiaomi: A Complete Guide to Unlocking the bootloader

Installing custom TWRP on Xiaomi smartphones gives you access to advanced features, from backup to unofficial ROM firmware. However, the process requires care - an error at any stage can turn a device into a "brick." In this article, we will analyze all the steps from unlocking the bootloader to choosing the right version of TWRP for your model, taking into account the features of MIUI and antirollback.

It's important to understand that Xiaomi is actively blocking informal firmware manipulation.The latest models (e.g. Xiaomi) 13/14 or Redmi Note 12) require the circumvention of protection through EDL-We'll look at the universal methods that work on most devices, and we'll also point to the pitfalls that many guides don't mention.

1. Device Preparation: What to Do Before Installing TWRP

Before you start firmware, make sure your smartphone is ready for the procedure. Failure to comply with preconditions is the main reason for the β€œbricking” of devices.

First, check the model and codename of your Xiaomi. For example, the Redmi Note 10 Pro can have either sweet (global) or sweetin (Indian) options. You can find out the code name through the Mi Check app or the ADB team:

adb shell getprop ro.product.device

Second, upgrade your firmware to the latest stable version of MIUI. This minimizes the risk of conflicts with TWRP. Use the official update via Settings β†’ About Phone β†’ System Update.

  • πŸ“± Save the data: TWRP It doesn’t always work well with encryption. FBE (File-Based Encryption! backup via Mi Cloud or Google Drive is mandatory.
  • πŸ”‹ Battery charge: at least 70% Unlocking and firmware process can take up to 30 minutes.
  • πŸ–₯️ PC Windows/Linux: You will need to work with Fastboot and ADB. MacOS may have problems with drivers.
  • πŸ”— Cable USB: Original or certified. Cheap cables often cause data transmission errors.

⚠️ Note: If your device was purchased in China (the domestic version), unlocking the bootloader may require a link to your Chinese Mi Account. FAQ.

πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 10/11/12
Xiaomi 11/12/13
POCO F3/4/5
Another model

2 Unlocking the bootloader: official and informal ways

The bootloader on Xiaomi is locked by default, and unlocking it is a must before installing TWRP. The official method through the Mi Unlock Tool works, but has limitations:

  • ⏳ Wait 7 days (168 hours) after linking your Mi Account to your device.
  • πŸ”— Tethering SIM-Maps: Some models require insertion SIM same region as the firmware.
  • 🚫 Limitation on the number of unblocks: 1 account = 1 device per month.

The alternative method is the use of EDL-The Emergency Download Mode is a method that is risky because it requires a user to use an authorized account:

  1. Transfer the device to EDL via a button combination or short circuit testpoints.
  2. Use of paid services (Mi Flash Pro, ChinaFirewall) or free scripts (e.g. edl.rb for Linux).
Unlocking methodWaiting timeRisks.Suitable for
Official (Mi Unlock Tool)7 daysMinimumAll models except the Chinese versions
EDL (Authorized Account)5-30 minuteHigh (Ban Account Risk)Xiaomi 12/13/14, Redmi K50
Bypassing Fastboot (exploits)1-2 hoursMedium (may not work)POCO F3, Redmi Note 10 Pro

For official unlocking:

  1. Download Mi Unlock Tool (version no lower than 5.5.224.30).
  2. Enable OEM Unlock in Settings β†’ For Developers.
  3. Link your Mi Account to Settings β†’ Xiaomi Account β†’ Mi Cloud.
  4. Connect your phone to your PC in Fastboot mode (clip Volume Down + Power).
  5. Start the Mi Unlock Tool and follow the instructions.

⚠️ Warning: If you see a "Couldn't unlock" error when unlocking, check: Mi Unlock Tool Version (older versions don't work with new devices). SIM-Cards (some models are required) SIM The presence of an antivirus on a PC (it can block the tool).

3.Selecting the Right TWRP Version for Your Xiaomi Model

The error in choosing a version of TWRP is the second most common cause of bricking. Don’t use generic builds – they may not support FBE encryption or Dynamic Partitions (introduced in Android 10+).

Official TWRP builds are available at twrp.me, but many Xiaomis require unofficial ports.

  • πŸ” On the forum XDA Developers (Search for the theme of your model).
  • πŸ“₯ In Telegram-channels of developers (for example, @twrp_xiaomi).
  • πŸ› οΈ Through search bots unofficial Recovery.

Check the compatibility of the TWRP version with your firmware:

Xiaomi modelCode nameRecommended version of TWRPNotes
Redmi Note 10 Prosweet3.7.0_12-0 or newerSupports MIUI 14 but requires avb2.0 to be disabled
POCO F3alioth3.6.2_11-0 (informal)It works with Android 13 but doesn’t support encryption.
Xiaomi 12cupid3.7.0_12-1 (Globally only ROM)China ROM requires a patch for anti-rollback

Critical: If your device is running Dynamic Partitions MIUI, a standard TWRP won't work. In this case, you need a patched reavers that support super.img. Examples of such devices are Xiaomi 11/12/13, Redmi K40/50.

Downloaded the version. TWRP It's for your codename.|Checked the reviews on the assembly XDA or 4PDA|I am sure the version supports the current version. MIUI|Retained a link to the backup version TWRP bug-in-->

4. Install TWRP via Fastboot: step-by-step instruction

The most reliable way to flash TWRP is through Fastboot.

  1. Download Platform Tools (includes fastboot and adb).
  2. Unpack the archive into the root of the disk C:\platform-tools\ (Windows).
  3. Place the twrp.img file in the same folder.
  4. Open the command prompt in this folder (Shift + PCM β†’ Open the PowerShell window here).

Next, execute the commands in order:

adb reboot bootloader


fastboot flash recovery twrp.img




fastboot reboot recovery

If after rebooting the system in TWRP, the system offers to enter a password (due to FBE encryption), follow the following steps:

  1. Connect the phone to the PC.
  2. In TWRP, go to Advanced β†’ File Manager.
  3. Delete /data/system/locksettings.db.
  4. Reboot to the system.

⚠️ Attention: On Android devices 12+ and MIUI 13/14 post-fix TWRP If the phone is stuck on the Mi logo after the reboot, you need to flash the full firmware package through the Fastboot with the flag. --disable-verity.

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

(file vbmeta.img You can get it from the official firmware).-->

5. Alternative methods of installing TWRP

If Fastboot is not working (for example, due to a blocked bootloader), you can use:

Method 1: ADB Sideload

Suitable for devices where custom recapvere already installed, but you need an update:

  1. Load into the current Recovery.
  2. Select Advanced β†’ ADB Sideload.
  3. On PC, do: adb sideload twrp.zip

Method 2: Through the OrangeFox or PitchBlack app

Some alternative recavators (e.g. OrangeFox) have a built-in TWRP installer.

  1. Install OrangeFox via Fastboot.
  2. From the Recovery menu, select Install β†’ Install Recovery β†’ TWRP.
  3. Specify the path to the twrp.img file.

Method 3: Through EDL (for advanced users)

If the bootloader is locked and official unlock is not available, you can flash TWRP through EDL:

  • πŸ”§ Use the script edl.rb (for the purpose of Linux/MacOS).
  • πŸ“‚ Please. recovery.img and vbmeta.img simultaneously.
  • ⚠️ Risk: wrong actions in EDL damage EFS-section (responsible for IMEI).
What if the phone does not turn on after TWRP firmware?
If the device does not respond to the power button, try: 1. Clip Volume up + Power for 20 seconds (forced reboot). 2. Connect to charge for 1 hour - sometimes helps with battery discharge during the firmware process. 3. Swipe the full firmware through the Mi Flash Tool in Clean All mode. If nothing helps, you will need to flash through EDL with an authorized account (Mi Authorized Account).

6. Common mistakes and their solutions

Even with the correct following of the instructions, errors can occur.

Mistake.Reason.Decision
FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlockedRepeat the unlocking procedure with the Mi Unlock Tool
Invalid sparse file format at headerThe damaged twrp.img fileDownload the image again, check the MD5 checksum
TWRP is flashed but not launched (returns to Fastboot)An anti-rollback or incompatible versionSwitch vbmeta.img with the check turned off or use the patched TWRP
E: Unable to mount /dataFBE encryption or a corrupted file systemIn TWRP, run Format Data β†’ Yes (Erase all data!)

If the system does not boot after installing TWRP, check:

  • πŸ”„ Version MIUI: on MIUI 14 may require a rollback to MIUI 13 before firmware.
  • πŸ” bootloader status: Fastboot oem device-info (should be unlocked: true).
  • πŸ“¦ Integrity of the firmware: if after TWRP you've sewn a custom ROM, Make sure it is compatible with your model.

πŸ’‘

If TWRP is stitched but not launched, 90% of the time the anti-rollback or incompatible version of the recaveri is to blame. Always check compatibility on XDA before firmware.

7 What to do after installing TWRP

Successful TWRP installation is only half the battle, so you can avoid problems in the future.

  1. Backup: In TWRP: Backup β†’ Select partitions (Boot, Data, System) β†’ Swipe to Backup Save a copy to PC or cloud.
  2. Turn off forced encryption (if necessary): In TWRP: Wipe β†’ Format Data β†’ type "yes" This will delete all data but solve /data mounting problems.
  3. Sweep Magisk for root rights: In TWRP: Install β†’ Select Magisk.zip β†’ Swipe to Confirm Flash

If you plan to flash custom ROMs (like LineageOS or Pixel Experience), consider:

  • πŸ”„ Anti-rollback: Some firmware can roll back version MIUI, which will lead to the device block.
  • πŸ“‘ modem IMEI: After the firmware check the network operation with the command ##4636##.
  • πŸ”‹ Autonomy: custom ROM They can increase the battery consumption of 15-20%.

⚠️ Attention: If you have passed GSI-The firmware (Generic System Image), and the camera or fingerprint sensor does not work, this is due to the lack of proprietary Xiaomi drivers. vendor.img stock-stack.

8.How to return stock recavers and block the loader

If you decide to return to the original state (for example, for warranty repairs), follow the following steps:

  1. Download the official firmware for your model from the MIUI Downloads website.
  2. Unpack the archive and find the recovery.img file.
  3. Fastboot: fastboot flash recovery.img fastboot reboot
  4. To lock the bootloader, use the command: fastboot oem lock ⚠️ This erases all data and returns the device to factory settings!

After locking the loader:

  • πŸ”„ The device will return to the drainage recaveri.
  • πŸ”’ OEM Unlock in Developer Settings will be unavailable for 7 days.
  • πŸ“± Xiaomi warranty will be restored (unless there was physical damage).

If the phone doesn’t turn on after locking, run the full firmware through the Mi Flash Tool in Clean All and Lock mode.

πŸ’‘

Before locking the bootloader, make sure the device has official firmware installed. Castom ROM or Magisk with the bootloader locked will result in a bootloop ( looped reboot).

FAQ: Frequent questions about installing TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
No, on all modern Xiaomi devices (starting with the Redmi Note 7), unlocking is mandatory, with the only exception being the use of exploits like DirtyCOW, but they only work on older versions of Android (up to 9.0).
Why does TWRP stitch up, but disappears when you restart?
This is because of the anti-rollback function, or because the stock firmware overwrites the Recovery. Solutions: vbmeta.img with the check turned off: fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img Use it. TWRP supportive A/B Partitions (for Android devices) 10+). After the firmware TWRP Reboot it immediately, preventing the system from starting.
How to get around the wait of 7 days when unlocking the bootloader?
Officially, no way, but there are informal methods: πŸ”§ Use of the EDL-Regime with an authorized account (paid, ~$5-10). πŸ“± Fastboot firmware with check-bypass (does not work on all models). πŸ•’ Resetting the timer by changing the date on the phone (sometimes works on older devices). ⚠️ Risk: Unofficial methods can lead to banning of Mi Account.
Can I install TWRP on Xiaomi with a MediaTek processor?
Yeah, but the process is more complicated than Qualcomm: πŸ”§ Required. SP Flash Tool instead of Fastboot. πŸ“‚ You need to download a scatter file for your model. ⚠️ High risk of damage IMEI Examples of supported models: Redmi Note 9/10 (MediaTek), POCO M3.
What if after TWRP firmware the phone asks for a password, but it is not?
This is an issue with FBE encryption. Solutions: In TWRP, go to Wipe β†’ Format Data (erases all data!). Or delete the file /data/system/locksettings.db via File Manager in TWRP. If nothing helps, run the stock firmware through Fastboot.