Installing TWRP on Xiaomi: A Complete Guide from Unlocking to Firmware

Installing custom TWRP on Xiaomi smartphones gives you access to advanced device management capabilities, from creating full backups to firmware informal ROM. However, the process requires care - errors at the stage of unlocking the bootloader or firmware can lead to a "brick" (inoperability) of the phone. In this guide, we will analyze all the steps from tool preparation to the final test of TWRP.

It is important to understand that the procedure differs for different models Xiaomi/Redmi/POCO. For example, Xiaomi 13 Pro and Redmi Note 12 use different versions of the recovery, and some devices (for example, POCO F5) may require additional configuration of VBmeta. We take these nuances into account and provide universal solutions with a focus on the current models of 2023-2026.

Before you start, make sure you're prepared for the risks of losing warranty, resetting data, manual system repair. If your goal is just to get root rights, consider alternatives like Magisk without completely replacing the backup. For experienced users, TWRP will be a powerful tool, but for beginners, we recommend that you follow the instructions carefully.

Preparation: What You Need Before Installing TWRP

Before starting the procedure, collect all the necessary tools and files. Without proper preparation, you risk errors such as Fastboot unknown command or the inability to unlock the bootloader.

  • πŸ“± Xiaomi smartphone with a battery charge of at least 70% (critical for avoiding failures).
  • πŸ’» Computer running Windows 10/11, macOS or Linux (macOS will require additional drivers).
  • πŸ”Œ Cable USB Type-C (preferably original – cheap cables can cause connection problems).
  • πŸ› οΈ Utilities: ADB Fastboot (part of Google’s Platform Tools), Mi Unlock Tool for unlocking the bootloader.
  • πŸ“ File. TWRP for your model (download only from the official website twrp.me or trusted sources such as: XDA Developers).

Pay special attention to the choice of version TWRP. For example, for Xiaomi. 12T fit twrp-3.7.0_12-v7.0_A13-plato.img, And for the Redmi Note. 11 Pro+ β€” twrp-3.6.2_11-v6.7_A12-peux.img. Firmware and recovery versions are common causes of errors. MIUI in the phone settings (Settings) β†’ The phone. β†’ Version. MIUI).

⚠️ Note: If your device is running Android 13+ With a security patch newer than June 2023, you may need to roll back to an older version MIUI before installation TWRP. This is due to the tightening of Xiaomi’s security policy.

Also back up your important data. Installing TWRP involves completely resetting the data partition if you plan to flash custom ROMs.

  • πŸ“Ž Mi Cloud (for contacts, notes, photos).
  • πŸ’Ύ Local Copying on PC (for files in folders) DCIM, Downloads).
  • πŸ”„ Apps like Swift Backup (require root, but saves application settings).
πŸ“Š What Xiaomi model do you use?
Redmi Note 10/11/12
POCO F3/F4/F5
Xiaomi 12/13/14
Another model

2. Unlock the bootloader on Xiaomi

The bootloader on Xiaomi smartphones is locked by default, and unlocking it is a mandatory step before installing TWRP. The process takes 3 to 7 days due to Xiaomi’s policy, which requires waiting for confirmation through a Mi Account.

Here's the step-by-step instruction:

  1. Link your Mi Account to your device: Go to Settings β†’ Xiaomi Account. Sign in to your account (if not, register a new one), activate the Data Sync option and Find your device.

Allow debugging over USB and unlocking OEM:

  • Back to Settings β†’ Additionally. β†’ For developers.
  • Enable USB Debugging and OEM Unlocking.

Then connect your phone to your PC and start the Mi Unlock Tool (download the latest version from the official website). Log in to the same Mi Account as the phone. The utility will show a waiting timer (usually 168 hours for new accounts).

⚠️ Warning: If a Couldn't unlock error occurs when unlocking, check: Mi Account is tied to your phone for more than 7 days. The device has a mobile network or Wi-Fi enabled (unlockable without an Internet connection). USB.

A tied Mi Account|Debugging is on. USB|Unblocking permitted OEM|Drivers installed ADB/Fastboot|Battery charge >70%-->

3. Install ADB and Fastboot on PC

To run TWRP through Fastboot, you need to configure the ADB environment on your computer, so you can send commands directly to the bootloader.

For Windows:

  1. Download Platform Tools from Google.
  2. Unpack the archive into the root of the disk C:\platform-tools\.
  3. Add a path to the folder to the environment variables: Open Control Panel β†’ System β†’ Additional System settings β†’ Environment variables. In Path, add the line C:\platform-tools\.

ADB

adb version

The utility version should be displayed (e.g. 1.0.41).

For macOS/Linux:

Use the package manager:

  • 🍎 macOS (via Homebrew): brew install android-platform-tools
  • 🐧 Linux (Debian/Ubuntu): sudo apt install adb fastboot

After installation, connect the phone to the PC and do:

adb devices

If the device appears in the list (e.g., 1234abcd device), the ADB works correctly. If not, check the drivers or try another cable.

πŸ’‘

If the adb device command returns unauthorized, the phone will receive a request for debugging permission, confirm it and repeat the command.

4. TWRP firmware via Fastboot

When the bootloader is unlocked and the ADB/Fastboot is configured, you can start the TWRP firmware. This process consists of several critical steps:

  1. Turn your phone into Fastboot mode: Turn off the device. Press the Power button + Volume down for 10 seconds. The hare in the ear hat appears on the screen β€” this is Fastboot mode.

Connect your phone to your PC and check the connection:

fastboot devices

The serial number of the device must be displayed.

TWRP:

fastboot flash recovery twrp.img

Replace. twrp.img to your file name (for example, twrp-3.7.0_12-v7.0_A13-plato.img).

Replace the RecavΓ©ri system with:

fastboot flash recovery_ab twrp.img

On partition devices recovery_ab (for example, Xiaomi 12/13 (a) this step is mandatory, otherwise MIUI re-write TWRP first-time.

After successful firmware, restart the TWRP command:

fastboot boot twrp.img

If it went right, you'll see the main TWRP menu with a touch interface, and if the screen is black or the MIUI logo appears, the firmware failed.

  • πŸ”„ Repeat the process with another version TWRP.
  • πŸ“₯ Check the integrity of the downloaded file (for example, through the hash amount). SHA-256).
  • πŸ”§ Make sure the bootloader is truly unlocked (fastboot oem device-info should show Device unlocked: true).
What to do if TWRP does not start?
If you have a fastboot boot twrp.img phone loads into MIUI, The anti-Rollback defense system probably worked: 1. Please. TWRP in both slots (recovery and recovery) recovery_ab). 2. Turn off signature verification in TWRP (Recovery). 3. Use the patched one. boot.img with disabled check (for example, through Magisk).

5. TWRP setup and reset prevention

After the first TWRP launch, several steps need to be taken to prevent it from being replaced by MIUI when it is rebooted, especially for Android 12+ devices.

Steps to set up:

  1. Create a recovery backup: In the main TWRP menu, select Backup. tick only Recovery. Press Swipe to Backup.
  2. Turn off signature verification: Go to Settings β†’ Zip signature verification. uncheck the Enable zip signature verification box.

boot.img

  • If you plan to get root, download boot.img from your firmware.
  • Patch it through Magisk and run it through TWRP (Install β†’ Select Image β†’ boot.img).

To prevent MIUI from overwriting TWRP every time you restart, use the command:

fastboot flash recovery --disable-verity --disable-verification twrp.img

Some models (e.g., POCO F4) may require additional firmware vbmeta:

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

⚠️ Note: If after these manipulations the phone stops booting into the system, try flashing the original boot.img This often solves loop loading problems (bootloop).

Xiaomi modelDoes the firmware need vbmeta?Does A/B support slots?
Xiaomi 13/13 ProYes.Yes.
Redmi Note 12 Pro+Yes.Yes.
POCO F5No.Yes.
Xiaomi 11TYes.No.
Redmi 10No.No.

6. Solving common errors

When installing TWRP, users often face typical problems, and let's look at the most common ones and how to fix them.

Fastboot: Unknown Command [flash]

Reason: Wrong path to Fastboot or lack of rights.

  • πŸ”Ή Make sure you are in a folder with platform-tools (use cd) C:\platform-tools\).
  • πŸ”Ή Run the command line on behalf of the administrator.

Error: This package is for 'plato' devices; this is a'

Reason: discrepancy between the TWRP model and the device.

  • πŸ”Ή Check the code name of your model (e.g. plato for Xiaomi) 12T).

Error: The phone does not turn on after the firmware

Cause: damage to the boot or recovery partition.

  • πŸ”Ή Try to boot up in. TWRP via fastboot boot twrp.img.

Failed to mount /data (Invalid argument)

The reason: encrypted data section on Android 10+.

  • πŸ”Ή V TWRP Go to Wipe. β†’ Format Data and enter Yes.
  • πŸ”Ή After formatting, reboot to TWRP.

πŸ’‘

If the phone does not boot after installing TWRP, the first thing to do is check the integrity of the embroidered boot and recovery partitions. 90% of the time, the problem is solved by re-running the original boot.img firmware.

7.Follow-up after installation of TWRP

Successful TWRP installation is just the first step. Now you can:

  • πŸ”§ Get root rights: Fly Magisk through Install β†’ Select Zip in the TWRP.
  • πŸ“¦ Install custom firmware: download LineageOS, Pixel Experience or other ROM in.zip format and run through TWRP.
  • πŸ’Ύ Create a full backup: in the main menu, select Backup and mark all sections (Boot, System, Data, EFS).
  • πŸ”„ Restore Stock Firmware: If something goes wrong, you can always roll back through Restore to the Restore. TWRP.

To firmware custom ROMs through TWRP, follow this algorithm:

  1. Download firmware (like LineageOS 20) and GApps (if you need Google services).
  2. Reboot to TWRP.
  3. Run Wipe β†’ Advanced Wipe and mark Dalvik, Cache, System, Data.
  4. Select the firmware (Install β†’ select ZIP).
  5. Please use GApps (if required).
  6. Reboot to the system (Reboot β†’ System).

Remember that after firmware custom ROM may require reconfiguration of TWRP, as some firmware (such as Pixel Experience) overwrite the Recovery.

8. Frequently Asked Questions (FAQ)

❓ Do I need to unlock the bootloader for installation? TWRP?
Yes, without unlocking the bootloader, you can't flash TWRP. This is a Xiaomi security requirement, and it can't be circumvented by legal methods. Unlocking takes up to 7 days for new Mi accounts.
❓ Can we determine TWRP computer-free?
Technically, but it's risky. Some users run TWRP through apps like Flashify or OrangeFox Recovery, but it only works on devices that are already unlocked. You'll need an ADB/Fastboot PC to start.
❓ Why After Installation TWRP phone doesn't load?
Most likely causes: TWRP version mismatch with phone model; boot partition damage (solved by the original boot.img firmware); Anti-Rollback activated (some Xiaomi models require a rollback to an older version of MIUI after TWRP firmware). Try booting to TWRP via fastboot boot twrp.img and recovering the backup.
❓ How to update TWRP before?
Update TWRP It runs the same way as the original installation: Download the new version of the.img file. TWRP. Choose Install. β†’ Install Image and enter the new file. Click on the Recovery section. recovery_ab Repeat the firmware for the second slot.
❓ Can I remove it? TWRP and return the stock Recovery?
Yes, for this: Download the original Recovery for your model (usually part of stock firmware).Sweep it through Fastboot: fastboot flash recovery stock_recovery.img Reset the device. MIUI will stop replacing the receptacles when loading.