How to Install TWRP Recovery on Xiaomi via Computer: Complete Guide 2026

Installing custom TWRP on Xiaomi smartphones provides access to advanced features: system backup, firmware informal ROM and even recovery of bricks. However, the process requires care - an error at any stage can lead to locking the device requiring authorization Mi Account even after reset. In this guide, we will discuss the official method of installation via PC using ADB and Fastboot, relevant for models 2020-2026.

It’s important to understand that Xiaomi actively blocks unauthorized modifications. The consequences can range from loss of warranty to complete loss of functionality of the device. For example, new models (for example, Xiaomi 13 Series or Redmi Note 12 Pro+) require additional unlocking of Anti-Rollback protection. We will discuss all the nuances in detail, including driver preparation, choosing the correct version of TWRP and bypassing typical errors like Invalid sparse file format at header.

Preparation of the device: unlocking the loader

The first and mandatory step is to unlock the bootloader, without which no custom recavator will boot. Xiaomi requires official confirmation through the Mi Account, and on new devices (released after 2021), the waiting period can reach 720 hours (30 days).

To start the process:

  • πŸ“± Go to Settings. β†’ The phone. β†’ Version. MIUI and tap 7 times on the line to activate Developer Mode.
  • πŸ”“ Back to Settings β†’ Additionally. β†’ For developers and include OEM-unlocking and debugging USB.
  • 🌐 Attach the device to Mi Account in Settings β†’ Xiaomi account β†’ Mi Cloud (required to confirm email and phone number!).
  • πŸ–₯️ Install Mi Unlock Tool on PC and log in under the same account.

⚠️ Attention: On Redmi models K50, POCO F5 Xiaomi may request confirmation via SMS If the device was purchased on credit or lease, unlocking may not be possible due to the operator's binding.

After sending the unblocking request:

  • Connect your phone to your PC in Fastboot mode (turn off the device, then press Volume Down + Power).
  • Run the Mi Unlock Tool and follow the instructions. If you see a "Couldn't unlock" error, check that the OEM Unlock option is included in the For Developers.
πŸ“Š What Xiaomi model do you use?
Redmi Note 11/12
POCO X/F series
Xiaomi 12/13
Redmi K40/50
Another model

2. Installation of drivers and tools on the PC

To work with ADB and Fastboot, you will need:

  • πŸ–₯️ Windows 10/11 (on Linux/Mac The commands are similar, but the paths to drivers are different).
  • πŸ”Œ Xiaomi drivers for Fastboot (download from the official website).
  • πŸ› οΈ Google Platform Tools (includes adb.exe and fastboot.exe).

Installation instructions:

  1. Unpack Platform Tools at the root of the disk C:\platform-tools\ (pathless!).
  2. Connect your phone in Fastboot mode and check for device detection by command: fastboot devices If the list is empty, install drivers manually through Device Manager (select Android Bootloader Interface).
  3. For models on Qualcomm Snapdragon (e.g., POCO F4), download the QDLoader HS-USB Driver.

⚠️ Note: Antiviruses (such as Avast or Kaspersky) can block adb.exe as a "suspicious file." Add the platform-tools folder to the exceptions.

πŸ’‘

If the fastboot device command doesn’t show the device, try another one. USB-port (preferably) USB 2.0 on the back of the PC) or cable from the package.

3.Selecting the Right Version of TWRP

Mistake in choosing the version of the Recaveri is the main reason for the β€œbricks". TWRP must be appropriate:

  • πŸ“± Device models (e.g. Redmi Note 11 Pro) 5G β‰  Redmi Note 11 Pro+ 5G).
  • πŸ”’ Codename (e.g., vili for Xiaomi) 11T Pro).
  • πŸ“… Versions MIUI (Newer scaling may be required TWRP dm-verity).

Where to download:

  • 🌍 Official website: twrp.me/Devices (Look for the device code).
  • πŸ“₯ Telegram channels: @TWRP_Xiaomi or @XiaomiFirmwareUpdater (current builds for new models).
  • πŸ”§ Forum XDA Developers (for example, a branch for Xiaomi).
Xiaomi modelCode nameTWRP referenceNotes
Redmi Note 10 ProsweetDownloadSupports MIUI 13/14
POCO X3 ProvayuDownloadRequires AVB 2.0 shutdown
Xiaomi 12T ProditingXDAOnly for firmware on Android 12

Before downloading, check the hash file (MD5) - fake TWRP builds may contain malicious code.

certUtil -hashfile twrp-3.7.0_12-vili.img MD5

4. TWRP firmware via Fastboot

Now, to the most critical point, the important thing is that if your device has Anti-Rollback enabled (e.g., on the Redmi K40 or Xiaomi 11 Lite NE), the firmware of the old version of TWRP will lead to locking. Always use the latest build!

Step-by-step:

β˜‘οΈ Firmware TWRP via Fastboot

Done: 0 / 5
  1. Place the twrp version-name-img file in the folder C:\platform-tools\ and rename it in twrp.img.
  2. Open the command line in this folder (press Shift + PCM β†’ Open in the terminal).
  3. Check the connection of the device: fastboot devices should display the serial number of the phone.
  4. Please. TWRP: fastboot flash recovery twrp.img For partition devices recovery_ramdisk (for example, POCO F3) Use: Fastboot Flash recovery_ramdisk twrp.img
  5. Reboot to Recavers without releasing the volume button up: fastboot boot twrp.img

⚠️ Note: On some models (for example, Xiaomi 12 Pro) after firmware TWRP The system can automatically overwrite it to the stock Recovery, so to avoid that, right after you enter the system. TWRP Go to Advanced. β†’ Flash Current TWRP.

What to do if TWRP does not start?
If you have a fastboot boot twrp.img loader MIUI, signifier: 1. Wrong version TWRP (check the code name). 2. Blocking the rollback (you need to flash the stock firmware with the same version number). 3. Some models (e.g. Redmi Note) 11S) First, you need to disable signature verification in the kernel through the fastboot command. --disable-verity --disable-verification flash vbmeta vbmeta.img (file vbmeta.img can be extracted from the stock firmware).

5. Typical errors and their solutions

Even if you follow the instructions accurately, you can get errors.

Mistake.Reason.Decision
FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlockedRepeat the unlocking process with the Mi Unlock Tool
Invalid sparse file format at headerA damaged TWRP file or incompatible versionDownload the file again, check it out. MD5-hash
The device is loaded into a stock RecoveryMIUI overwrites TWRP when downloadingIn TWRP, run Advanced β†’ Flash Current TWRP
fastboot: error: Cannot generate image for userdataThere is not enough space in the userdata sectionUse the command fastboot flash recovery twrp.img parameterless --slot=all

If the phone doesn’t turn on after installing TWRP (black screen or logo hover), try:

  • πŸ”„ Fastboot: Fastboot Flash Recovery recovery.img (file recovery.img You can get it from the official firmware).
  • πŸ“₯ Swipe the full stock firmware through the Mi Flash Tool (select Clean All mode).
  • πŸ”§ On models with Dynamic Partition (e.g. Xiaomi 12 Series), you may need to manually change the partition table via fastboot resize-logical-partition.

πŸ’‘

If TWRP It's successfully installed, but it doesn't hold up after it's restarted, and the problem is that it automatically overwrites the system. TWRP file disable_dm-verity_forceencrypt.zip (download XDA).

6. Additional settings after installing TWRP

After successful installation, it is recommended to follow several steps for stable operation:

  • πŸ”’ Turn off data encryption (if you don’t plan to use it): TWRP Go to Wipe. β†’ Format Data and enter yes. This will prevent partition mounting problems.
  • πŸ“ Create a backup: in the main menu TWRP Select Backup and select Boot, System, Data, Vendor. SD-card.
  • πŸ”„ Install Magisk for root rights: download the latest version Magisk.zip from GitHub and run through Install β†’ Select Zip.

For models with AB-sections (e.g, POCO F4 Xiaomi 11T) After the Magisk firmware is necessary:

  1. Download Magisk.apk and rename it Magisk.zip.
  2. Swipe it in both slots: fastboot --slot=all flash boot magisk_patched.img
  3. Reboot and wait for application optimization.

If after installing Magisk, the device is stuck on the boot, try:

  • Swipe boot.img from stock firmware on top of the patched one.
  • Disable all Magisk modules in the superuser settings.
  • Use an alternative root method via KernelSU (relevant to Android 13+).

7.Restore the device after a failed firmware

If something goes wrong and the phone turns into a brick, don't panic. In most cases, Xiaomi can be restored. The main thing is not to try to stitch random files, this can make things worse.

Algorithm of action:

  1. Identify the type of "brick": πŸ”΄ Soft-brick: The device is turned on but stuck on the logo or downloaded to Fastboot. ⚫ Hard-brick: phone doesn’t respond to buttons, doesn’t detect PC.
  2. For Soft-brick: Flip the stock firmware through the Mi Flash Tool (clean all mode). If the bootloader is locked, unlock it again through the Mi Unlock Tool.

Hard-brick

  • Try to pinch Volume up + Volume down + Power for 20-30 seconds (hardware reset).
  • Use it. EDL-Mode (requires an authorized Xiaomi account and Qualcomm boxing).

⚠️ Note: On devices with a MediaTek chipset (e.g., Redmi) 10C or POCO M4 Pro) for restoration through SP Flash Tool will require Auth-file, which can only be obtained from official Xiaomi service centers.

If the device requires Mi Account authorization after resetting and you do not remember your account details:

  • Try to restore access via account.xiaomi.com.
  • If your account is linked to a phone number, request an SMS with a recovery code.
  • On some models (e.g. Redmi 9A) you can bypass the lock via Fastboot command: fastboot erase frp But this will only work if the bootloader is unlocked!

FAQ: Frequent questions about installing TWRP on Xiaomi

❓ Can we determine TWRP loader-free?
No, it's technically impossible. Xiaomi uses signed bootloader images, and any modification (including TWRP) requires official unlocking via the Mi Unlock Tool. Bypasses like DirtyCOW exploits only work on very old devices (until 2018 release).
❓ Why after the firmware? TWRP The phone doesn't see internal memory?
It's connected to the encryption enabled. FBE (File-Based Encryption Solutions: In TWRP Go to Wipe. β†’ Format Data (this will delete all data!) or snip through disable_dm-verity_forceencrypt.zip (It saves data, but disables encryption. 12+ Additional patches may be required for the metadata partition.
❓ How to check if the bootloader is unlocked?
Turn off your phone and press Volume Down + Power to log in to Fastboot. If the bottom of the screen says "Unlocked" with an open lock, the bootloader is unlocked. If "Locked" requires unlocking. On some models (for example, Xiaomi 13), status is only displayed when connected to a PC via fastboot oem device-info.
❓ What Xiaomi models do not support TWRP?
There is currently no official TWRP support for: HyperOS devices (new firmware 2026), Dynamic Partition and super.img models (e.g. Xiaomi 14 Series), some devices for the Chinese market (e.g. Xiaomi Civi 3), for which OrangeFox Recovery or Pitch Black Recovery are the alternatives.
❓ Can I get a root license without TWRP?
Yes, with Magisk in patch mode. boot.img: Download the stock. boot.img for your model (you can extract from the firmware through the Xiaomi Firmware Updater). Magisk.apk, Choose Install β†’ Select and Patch a File and specify boot.img. Squeeze the result. magisk_patched.img Fastboot: Fastboot Flash boot magisk_patched.img This method does not require TWRP, But the root rights will disappear after the update. MIUI.