Installing TWRP Recovery on Xiaomi via Fastboot: A Complete Guide to Unlocking the bootloader

Installing custom TWRP on Xiaomi smartphones opens up access to advanced features from NANDroid backups to firmware custom software like LineageOS or Pixel Experience. However, the process requires care – an error in unlocking the bootloader or firmware can turn the device into a β€œbrick.” In this article, we will discuss the official method of installing TWRP through Fastboot, which works on most Xiaomi, Redmi and POCO models (including Redmi Note 12 Pro+, Xiaomi 13 Ultra and other current devices from 2023-2026).

It’s important to understand that Xiaomi actively blocks unofficial backups, so once you install TWRP, you may need to disable the bootloader’s signature check or use patches to bypass restrictions. We’ll look at all the nuances, including driver preparation, bootloader unlocking, choosing the correct version of TWRP, and solving typical errors like FAILED (remote: β€˜Not allowed in Lock State’).

Preparation of the smartphone and PC: what to do before installation

Before you start firmware, make sure your device is compatible with TWRP. Not all Xiaomi models are supported by official builds, for example, Xiaomi 14 or Redmi. K70 You may need an unofficial port. Check the list of supported devices on the official website. TWRP.

Also prepare:

  • πŸ”Œ Cable USB Type-C (original or high-quality – cheap cables can cause data transmission errors).
  • πŸ’» Computer running Windows 10/11 (for Linux/macOS Additional drivers will be required).
  • πŸ“± Charged device (at least 60% – interruption of the process due to battery discharge leads to a brook).
  • πŸ” Mi Account tied to phone (required to unlock the bootloader).

If you are using Windows, turn off driver signature verification:

  1. Press Win + X β†’ select System Settings.
  2. Go to Update and Security β†’ Recovery.
  3. In the Special Download Options section, click Reboot Now.
  4. After the reboot, select Troubleshooting Search β†’ Additional settings β†’ Boot Options β†’ Reboot.
  5. Press F7 to disable mandatory driver signature verification.

⚠️ Note: If you use a laptop with ports USB 3.0 (blue connectors), connect your phone to the port USB 2.0 (black). Ports USB 3.0 can cause errors in fastboot commands.

πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 12/13
Xiaomi 13/14
POCO F5/X5
Another model

2 Unlock the bootloader on Xiaomi

Xiaomi locks the bootloader on all devices by default. TWRP cannot be installed without unlocking. The process takes 3 to 7 days (sometimes longer) due to company policy.

  1. Activate Developer Mode: Go to Settings β†’ About Phone. Click 7 times on the MIUI Version until you become a developer!
  2. Link the device to your Mi Account: Return to Settings β†’ Additionally. β†’ For developers. Activate. OEM-unlocking and debugging USB. Connect your phone to your PC and confirm debugging permission. Go to Settings β†’ Xiaomi account β†’ Mi Cloud and make sure your device is linked to your account.
  • Download Mi Unlock Tool (official utility from Xiaomi).
  • Start the program on behalf of the administrator.
  • Log in to your Mi Account.
  • Turn your phone into Fastboot mode (turn off the device, then press Power + Volume Down).
  • Connect your phone to your PC – the utility should detect it.
  • Press Unlock and wait for the process to be completed.

If the utility gives you an error Couldn't unlock. Wait for 168 hours is fine. Xiaomi requires a wait of 7 days from the first account link.

⚠️ Warning: Once the bootloader is unlocked, all user information (photos, apps, settings) will be deleted from the device!

What if the Mi Unlock Tool can’t see the device?
1. Check that the phone is in Fastboot mode (screen with a hare and a sign "FASTBOOT"). 2. Install Mi Flash Tool drivers manually through Device Manager. 3. Try another one USB-cable or port. 4. disable the antivirus - it can block the utility.

3. Installation of drivers and tools on the PC

To work with fastboot and firmware TWRP will require:

  • πŸ“„ File. TWRP for your model (download only from the official website or trusted sources such as: XDA Developers).

Installation instructions:

  1. Unpack Platform-Tools into the root of the C:\ drive (e.g., C:\platform-tools\).
  2. Place the TWRP file (usually with the.img extension) in the same folder.
  3. Open the Command Prompt on behalf of the administrator and go to the tool folder: cd C:\platform-tools\
  4. Check the connection of the device: fastboot devices If the phone is found, you will see its serial number.

If the fastboot device command does not show the device:

  • πŸ”„ Reinstall drivers manually through Device Manager (select Android Bootloader Interface).
  • πŸ”Œ Try another one. USB-port.
  • πŸ–₯️ Disable driver signatures (see Section 1).

πŸ’‘

If you’re using Windows 11, add a folder with platform-tools to the PATH environment variable, which will allow you to run fastboot commands from any directory.

4.Transform TWRP installation via Fastboot

Once the bootloader is unlocked and the tools are ready, we start firmware. Dynamic Partitions will require an additional step: vbmeta firmware to disable the check.

Instructions:

  1. Put your phone in Fastboot mode: adb reboot bootloader Or manually: turn off the device β†’ pinch Power + Volume Down.
  2. Check the connection: fastboot devices
  3. Please. TWRP: fastboot flash recovery twrp-3.7.0_12-0-redmi_note_12_pro_plus.img Replace the file name with the one that is relevant to your model!
  4. For devices with Dynamic Partitions (MIUI 12+): fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img If the file vbmeta.img No, use the empty: fastboot --disable-verity --disable-verification flash vbmeta vbmeta_empty.img
  5. TWRP: Fastboot Reboot Recovery

If you're in a standard MIUI recap after the reboot, then TWRP has been overwritten. This is a typical problem on new devices.

  • πŸ”„ Repeat the firmware. TWRP, But after the command fastboot flash recovery immediately perform: fastboot boot twrp-3.7.0_12-0-redmi_note_12_pro_plus.img It'll load. TWRP without writing to the recovery section, which will bypass the lock.
  • πŸ“± In fact. TWRP Go to Advanced. β†’ Flash Current TWRP (if the option is available).

Download the right TWRP file for your model

Is driver signature verification disabled (for Windows)

Is the device at least 60% charged?

Is the phone connected to the port? USB 2.0-->

5. Solving common installation errors

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

Mistake.Reason.Decision
FAILED (remote: 'Not allowed in Lock State')The bootloader is not unlockedRepeat unlocking via Mi Unlock Tool (see section 2)
FAILED (remote: 'Partition not found')The device uses Dynamic PartitionsSqueeze vbmeta with the flag --disable-verity
waiting for devicePC doesn't see the phoneCheck the drivers, cable, USB port. Reboot the PC.
After the reboot, MIUI Recovery is launched.Xiaomi re-writes TWRP when downloadingUse fastboot boot instead of fastboot flash
Invalid sparse file format at headerTWRP file damagedDownload the image again from the official source

If the phone does not boot into the system after installing TWRP, try:

  • πŸ”„ Switch the original recap through fastboot flash recovery stock_recovery.img (Download the Xiaomi Firmware Updater).
  • πŸ“± V TWRP run the Wipe β†’ Format Data (deletes all data, but often solves loading problems).
  • πŸ”§ Sweep through the full firmware package MIUI via fastboot with a flag --skip-secondary.

⚠️ Note: Some models (e.g. Xiaomi) 12T or Redmi K60) post-installation TWRP You may need to disconnect AVB 2.0 via command: fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img Without it, the system won't boot!

6. Additional settings after installing TWRP

Successful installation of TWRP is only half the battle, so to avoid problems in the future, set the Recovery correctly:

  • πŸ”’ Turn off automatic update of the recovery: TWRP Go to Settings. β†’ Prevent Stock ROM Flash (if available) will prevent overwriting TWRP renewal MIUI.
  • πŸ“ Backup: In the main menu, select Backup and save the Boot, System, Data, Vendor partitions. Store the copy on your PC or cloud.
  • πŸ”„ Set up. ADB Sideload: In Advanced β†’ ADB Sideload can be stitched ZIP-files (such as Magisk or custom firmware) without using a memory card.

For devices with Dynamic Partitions (most models on MIUI 12+), it is recommended to:

  • πŸ“Š Swipe a modified vbmeta to disable integrity check.
  • πŸ”§ Use OrangeFox Recovery instead of using it TWRP β€” It is an alternative recap with better support for dynamic partitions.

πŸ’‘

Once you install TWRP, never update via OTA (over the air) β€” this will lead to overwriting the Recovery and a possible breeze. Use only manual firmware via fastboot or TWRP.

7. How to Sweeten Magisk to Get Root Rights

TWRP is often installed to obtain root rights through Magisk. The process is simple, but requires caution:

  1. Download the latest Magisk ZIP.
  2. Move the file to your phone or memory card.
  3. Download to TWRP.
  4. Click Install β†’ select the Magisk file β†’ swipe for confirmation.
  5. After the firmware reboot to the system.

Check for root with the Magisk Manager app or command in the terminal:

su

If after the firmware Magisk system does not boot:

  • πŸ”„ Boot in. TWRP and sew Magisk-uninstaller.zip.
  • πŸ“± Delete Magisk data via Wipe β†’ Advanced Wipe β†’ Dalvik/ART Cache.
  • πŸ”§ Try another version of Magisk (like Magisk Delta for new devices).

FAQ: Frequent questions about installing TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
Xiaomi blocks the entry to the recovery section on locked devices, and any attempt to circumvent this restriction will result in a FAILED error (remote: 'Not allowed in Lock State').
Why does the phone not boot after TWRP firmware?
The reasons can be different: vbmeta won't flash, a TWRP file is damaged (download it again), an FBE encryption conflict (try formatting Data into TWRP), Solution: boot into TWRP, make Format Data, then flash Magisk or stock firmware.
How to return stock recap after TWRP?
Download the original recovery.img For your model with Xiaomi Firmware Updater, then run it through fastboot: fastboot flash recovery. stock_recovery.img After that, the unlocking of the loader will remain, but TWRP will be removed.
Does TWRP work on Xiaomi with HyperOS?
HyperOS (new firmware from Xiaomi, which replaced the new one) MIUI) They use the same protection mechanisms as MIUI However, some models (e.g. Xiaomi 14) may require special versions. TWRP with support for dynamic parts and AVB 2.0.Preliminary firmware check compatibility XDA Developers.
Can I install TWRP on Xiaomi via ADB (without Fastboot)?
Technically, yes, but it's a temporary solution. Adb reboot recovery will download TWRP, but it won't stitch it all the time.