Installing custom TWRP on Xiaomi smartphones gives you access to advanced features: backup creation, custom software firmware, root rights, and even repairing brick-and-brick devices. However, the process requires care β a mistake at any stage can turn a phone into a brick. In this article, we will analyze the step-by-step instructions for TWRP firmware through Fastboot, including unlocking the bootloader, preparing tools and solving typical problems.
Itβs important to understand that Xiaomi actively blocks the installation of unofficial firmware, so with each update to MIUI, the process becomes more complicated. For example, new models (for example, Xiaomi 13/14 or Redmi Note 12) may require additional disabling of Anti-Rollback or the use of special versions of TWRP. We will take into account these nuances and provide relevant solutions for 2026.
1.Preparation: What you will need before the firmware
Before you start, make sure you have everything you need, and without proper preparation, the risk of error increases dramatically.
- π± Xiaomi smartphone with unlocked bootloader (instruction below). Supported models from Redmi 4X Xiaomi 14 Ultra, but new devices (2023β2026) may require additional steps.
- π» Computer on Windows 10/11, macOS or Linux. On Windows, be sure to turn off driver signature verification (spoiler instruction).
- π Cable USB (Cheap cables can cause fastboot errors due to poor contact.
- π Firmware Files: Official Fastboot ROM For your model (downloaded from Xiaomi site). Latest version TWRP For your device (see twrp.me or XDA Developers. Tools ADB Fastboot (you can download it as part of Platform Tools).
Also check:
- π The battery charge of the smartphone is at least 70%, interruption of the process due to discharge is almost guaranteed to lead to "brickingΒ».
- π‘ Stable Internet connection (if you download files in the process).
- π Backup of important data. TWRP It does not erase data by itself, but unlocking the bootloader will reset the device to factory settings.
How to disable driver signature verification on Windows
1. Press Win + X β select Command Prompt (Administrator).
2. Enter the command:
bcdedit /set nointegritychecks on3. Restart the computer. After installing the drivers, return the settings with the command:
bcdedit /set nointegritychecks offWarning: If you use Xiaomi with a MediaTek processor (such as the Redmi Note 11 or POCO M4 Pro), the bootloader unlocking process may be different. These devices require a dedicated MTK Client or SP Flash Tool.
2. Unlock the bootloader on Xiaomi
Without unlocking the loader, flash TWRP Xiaomi requires official permission to unlock through the Mi Account, which takes up to 72 hours (on new devices) or is instantaneous (on older models).
- Link Mi Account to your device: Go to Settings β Xiaomi Account. Sign in (if not, sign up). Activate Settings β Additional β Unlock OEM (may be called OEM Unlocking). Enable USB Debugging in Settings β About Phone β MIUI Version (click 7 times on the line with the version, then return to Settings β Additional β For Developers).
- Download and install Mi Unlock Tool on your computer.
- Connect your phone to your PC in Fastboot mode: Turn off the device. Press Volume down + Power before the Fastboot logo appears.
Launch the Mi Unlock Tool, log in to the same Mi Account as the phone, and follow the instructions. If a Couldn't unlock or Wait 72 hours message appears, wait for the specified time.
Attention: On devices with MIUI 14+ and new processors (Snapdragon) 8 Gen 2/3) You may need to turn off the anti-rollback protection, and you need to flash a special anti-rollback patch through the TWRP... But how do you set it up if TWRP The solution is to use a temporary solution. TWRP In fastboot boot mode (more on this in the next section).
3. Install ADB and Fastboot: Step-by-step customization
The ADB (Android Debug Bridge) and Fastboot tools are required to communicate with the device via the command line, and can be installed in two ways:
- π¦ Download Platform Tools from Google (recommended): Download the archive from the official website. Unpack to the root of the disk C:\platform-tools (Path without spaces!) Add a folder to the environment variables: Open the Control Panel β System system β Additional system parameters β In the Path section, add a path to the platform-tools folder.
Installation through Android Studio
- Download Android Studio.
- Select SDK Manager β SDK Tools β Android SDK Platform-Tools.
Check the operation of the tools:
- Open the Command Prompt (Win + R β enter cmd).
- Enter the command: fastboot devices If the device is connected in Fastboot mode, you will see its serial number. If not, check the drivers (download Mi USB Driver).
π‘
If the fastboot command is not recognized, try running the command prompt on behalf of the administrator or specify the full path to the file, for example:
C:\platform-tools\fastboot devices4. TWRP firmware via Fastboot: step-by-step instruction
Now, we move on to the most important step - firmware TWRP. Follow the instructions carefully, as an error in this step can lead to data loss or "bricking" the device.
βοΈ Firmware preparation TWRP
0
Downloaded file TWRP for your model (for example, twrp-3.7.0_12-raphael.img)|Device in Fastboot mode (bunny logo)|Drivers. ADB/Fastboot fixed|Backup copy of data created
Step 1. Check the connection
Connect your phone to your PC and execute the command:
fastboot devicesIf the device is identified (a serial number appears), move on. If not, check the cable, USB port or drivers.
Step 2. TWRP firmware
Move a TWRP file (such as twrp.img) to the platform-tools folder and do:
fastboot flash recovery twrp.imgFor some models (Xiaomi) 12/13, Redmi K50) may need to be sewn TWRP slot-in (recovery_a and recovery_b):
fastboot flash recovery_a twrp.img
fastboot flash recovery_b twrp.imgStep 3: Banning TWRP overwriting
By default, MIUI overwrites TWRP with standard recaps on the first boot. To avoid this, immediately after the firmware, do:
fastboot boot twrp.imgThe device will load into a temporary TWRP.
- Go to Advanced β Flash Current TWRP (if you have one).
- Or manually flash a zip file from TWRP (downloaded separately from twrp.me).
Step 4: Reboot
After successful firmware, restart the device to TWRP:
fastboot reboot recoveryπ‘
If you are in a standard reboot MIUI, signifier TWRP It was overwritten. 3 or disable_forced_encryption.zip (encryption-based FBE).
5. Solving Typical Firmware Errors in TWRP
Even if you follow the instructions accurately, you can get errors, and let's look at the most common ones and how to fix them.
| Mistake. | Reason. | Decision |
|---|---|---|
| fastboot: error: cannot load 'twrp.img' | TWRP file not found or corrupted | Check the path to the file or download it again. Use the full path, for example: fastboot flash recovery C:\twrp\twrp.img |
| FAILED (remote: 'Flashing is not allowed in Lock State') | The bootloader is not unlocked | Repeat the unlocking process through the Mi Unlock Tool. If you wait 72 hours, wait. |
| Invalid sparse file format at header magic | Incompatible version of TWRP or corrupted file | Download TWRP from the official website for your model. Newer devices (Xiaomi 13) may require.img.tar TWRP. |
| The device is loaded into MIUI Recovery, not TWRP | MIUI re-recorded TWRP when downloaded | Please. disable_dm-verity_forceencrypt.zip temporary TWRP (Get the fastboot boot command twrp.img). |
Note: If the device does not turn on after TWRP firmware (black screen, vibration without logo), there is likely an error when unlocking the bootloader or firmware Anti-Rollback.
- Try booting up to Fastboot (Loudness Down + Power).
- Sweep through the official firmware via the Mi Flash Tool (select the clean all option).
- If it doesnβt help, contact the service center (you may need to sell EMMC).
What if the Mi Unlock Tool canβt see the device?
1. Check that the phone is in Fastboot mode (the rabbit logo).
2. Install Mi USB Driver drivers manually through Device Manager.
3. Try another one. USB-port (preferably) USB 2.0).
4. disable the antivirus (it can block the Mi Unlock Tool).
5. Use another computer (some Windows 11 PCs have compatibility issues).
6. Additional settings after installing TWRP
After a successful firmware TWRP, it is recommended to perform several actions for stable operation:
- π Turn off forced encryption (if enabled): Download disable_dm-verity_forceencrypt.zip (So, for example, from here. TWRP (Install β Select a file β Swipe to Confirm).
- π± Create a backup: In TWRP Go to Backup. Select the Boot, System, Data (optional) sections EFS For models with MediaTek, save the backup to SD-card.
- π Set up autoload in TWRP (for devices where MIUI Recapitalizes Recovery: Install the module TWRP A/B Retainer (available on XDA). Or patch it. no_verity_opt_encrypt.zip.
On dynamic partitions devices like the Xiaomi 12T or POCO F4, the standard backup in TWRP may not work, and use alternative tools like OrangeFox Recovery or PitchBlack Recovery.
7. Firmware custom software through TWRP
Now that TWRP is installed, you can flash custom firmware (like LineageOS, Pixel Experience) or get root rights through Magisk.
- π Check firmware compatibility with your model. For example, the firmware for the Redmi Note 10 Pro (sweet) will not work for the Redmi Note 10 (mojito).
- π Drop it. Dalvik/Cache after firmware (in) TWRP: Wipe β Advanced Wipe β Dalvik/ART Cache, Cache).
- π‘οΈ Turn off signature verification (if you are running unofficial software): fastboot flashing unlock_critical Warning: This command can lead to loss of warranty and increase the risk of brickingΒ»!
Example of Magisk firmware for root rights:
- Download the latest version of Magisk from GitHub.
- Move the Magisk-v26.4.zip file to your phone.
- In TWRP, select Install β Specify the Magisk β Swipe to Confirm file.
- Reset the device.
Note: On devices with MIUI 14+ and 5.10+ core (e.g. Xiaomi 13 Ultra), Magisk may not work due to System-as-Root (SAR) protection, in which case use alternative rooting methods, such as through boot.img patch.
8.Restore the device after a failed firmware
If something goes wrong and the phone stops turning on, don't panic. In most cases, the device can be restored.
- π§ Method 1: Download the official software via Mi Flash Tool download Fastboot ROM Unpack the archive into a folder without spaces (e.g, C:\Xiaomi\ROM). Connect your phone in Fastboot mode. Launch the Mi Flash Tool, point the way to the folder with the ROM and press Refresh. Select the clean all option and click Flash.
Method 2: Recovery through EDL-mode (for advanced)
- Suitable for devices with damaged bootloader.
- An EDL cable or short circuit of test points on the board is required.
- Mi Flash Pro or QFil (for Qualcomm) is used.
Warning: Firmware over EDL may cause IMEI loss or NFC/Wi-Fi module problems on some models (e.g. Redmi Note 9 Pro).Be sure to have a backup of modem and EFS partitions before using this method.
π‘
If after firmware is installed through the Mi Flash Tool, the device is loaded into the MIUI Recovery with this error MIUI version cannot be installed on this device, so you have flashed the software with the lower version of Anti-Rollback. MIUI.