Installing a custom TWRP recavator on Xiaomi smartphones is the first step to full control of the device, which allows you to install unofficial firmware, back up the system, obtain root rights and even restore bricks after unsuccessful experiments, but the process requires care: a mistake at any stage can lead to a locking of the phone or loss of warranty.
In this article, we will look at all the steps from unlocking the bootloader to choosing the right version of TWRP for your Xiaomi model, focusing on new models from 2023 to 2026 (Redmi Note 12, POCO X5, Xiaomi 13T, etc.), where the installation process is different from older devices, and learn how to avoid common errors like Fastboot mode or Anti-Rollback, which often occur in beginners.
Warning: the procedure requires basic knowledge of working with ADB and Fastboot. If you have never worked with the command line, it is better to train on an old device or learn our basic instructions. For owners of Xiaomi with MediaTek processors (for example, Redmi 10C or POCO M5), the process will be more difficult due to the features of the chipset β this will also be discussed separately.
1 What is TWRP and why is it needed on Xiaomi?
TWRP (Team Win Recovery Project) is a custom recovery that replaces the standard recovery menu on Android. Unlike stock recovery, it provides:
- π± Full system backup (including: /data, /system even EFS)
- π§ Installation of unofficial firmware (LineageOS, Pixel Experience, MIUI Pro and others.)
- π Getting root rights through Magisk or SuperSU
- π οΈ Recovery from a soft brick (when the phone doesnβt load but reacts to a Fastboot)
- π Editing System Files Directly from Recovery
On smartphones, Xiaomi TWRP is especially in demand due to the aggressive policy of the company: stock MIUI blocks many functions, and updates often come with a delay. For example, owners of Redmi Note 11 still do not get Android 14 in the official firmware, while custom builds based on AOSP have long supported the new version of the OS.
However, there are risks:
β οΈ Attention: Installation TWRP It resets all data on the device (if you don't backup in advance), and it also cancels the warranty - Xiaomi can refuse repairs if it finds traces of unlocking the bootloader. 12S Ultra) unofficial recovery installation may result in camera locking due to protection DRM.
If you use your phone to work with banking applications (Sberbank Online, Tinkoff), note that after obtaining root rights, they may stop working due to the SafetyNet trigger. This is solved by Magisk installation with the Universal SafetyNet Fix module, but requires additional manipulation.
Preparation of the device: unlocking the loader
Before installing TWRP, you need to unlock the bootloader. On Xiaomi, this is done through the official Mi Unlock Tool, but the process has several nuances:
- Your phone must be linked to a Xiaomi account (not Google!) without this, unlocking is impossible.
- Expectation 7-30 days. On new devices (2022 and later), Xiaomi introduced a mandatory wait after the account is tied. For example, for the Redmi Note 12 Pro+ it is 168 hours (7 days), and for flagships like Xiaomi 13 Ultra β up to 30 days.
- Initiation of debugging USB. Go to Settings. β The phone. β Version. MIUI and tap the build number 7 times to activate Developer Mode. β Additionally. β For developers, turn on: π Debugging by USB π Unlocking OEM (point!)
Download the Mi Unlock Tool from the official en.miui.com/unlock website (the version must match your MIUI) and note that the tool only works on Windows (macOS/Linux will have to use a virtual machine).
Link Mi to phone |Enable developer mode |Activate USB Debugging and OEM Unlock | Download Mi Unlock Tool from the official website |Wait 7-30 days (for new models)
-->
The unlocking process:
- Turn off the phone and press Volume Down + Power to log into the Fastboot.
- Connect your device to your PC and start the Mi Unlock Tool (required on behalf of the administrator!).
- Sign in to your Xiaomi account in the program.
- Press Unlock and wait until it is completed (usually takes 1-5 minutes).
Where to download TWRP:
| Source | Reference | Pluses | Cons |
|---|---|---|---|
| Official website of TWRP | twrp.me/Devices | β Verified assembliesβ Support for popular models | β No new devices (rarely updated) |
| XDA Developers | forum.xda-developers.com | β Active communityβ Unofficial ports for new models | β Risk of running into broken assembliesβ Registration is required |
| Telegram channels | @twrp_russia, @xiaomi_twrp | β Quick updatesβ Support for Russian-speaking users | β No guarantee of stabilityβ Possible viruses in archives |
| GitHub (Developer Repositories) | Example: mauronofrio | β Source code open.β Frequent updates | β It's hard to find the right model. |
How to determine the code name of your device:
- Install the CPU-Z or DevCheck app from Google Play.
- Check the Model or Codename field (e.g., surya for POCO X3 NFC).
- Check with the base on XiaomiFlash.
For models with a MediaTek processor (e.g. Redmi 10C, POCO M5), look for TWRP marked MTK. They have a different firmware mechanism via the SP Flash Tool, not the Fastboot.
-->
4. Install TWRP via Fastboot (for Snapdragon)
For most Xiaomi devices on Qualcomm Snapdragon (90% models), installation takes place via Fastboot.
- π₯οΈ Computer with Windows/Linux/macOS (Windows 10/11)
- π Cable USB Type-C (preferably original)
- π¦ Archives with TWRP (file extension)
- π οΈ Utilities. ADB Fastboot (you can download it in Android) SDK)
Step-by-step:
- Unpack the archive from TWRP in a folder with platform-tools (where adb.exe and fastboot.exe lie).
- Rename the file to twrp.img for convenience.
- Turn off the phone and press Volume Down + Power to log into the Fastboot.
- Connect the device to the PC and open the command line (Win + R β cmd).
- Check the connection command: fastboot devices Should display the serial number of the phone. If not, install the Mi USB Driver drivers.
- TWRP command: fastboot flash recovery twrp.img
- Reboot to Recovery: fastboot boot twrp.img (this is a temporary run to check the operability)
If TWRP is successfully loaded, you can flash it constantly:
- In TWRP, select Advanced β Flash Current TWRP (if you have one).
- Or repeat the command fastboot flash recovery twrp.img from PC.
β οΈ Note: On some models (Xiaomi) 11T Pro, POCO F4 GT) post-fix TWRP The stock receptacle automatically recovers when it reboots, so to avoid that, right after installation. TWRP Use Magisk or Disable Force Encryption (if you plan to use root).
What if Fastboot doesnβt see the device?
5. Installation of TWRP on MediaTek (Redmi 10C, POCO M5, etc.)
Devices on MediaTek (Helio G35/G88/G99, etc.) are wired differently through the SP Flash Tool, a riskier process, as an error can lead to a complete loss of IMEI or βbrickβ.
You'll need:
- π¦ Firmware (stock) ROM) For your model (you can download Xiaomi Firmware Updater)
- π οΈ SP Flash Tool (version 5.2124 or later)
- π§ MediaTek Preloader Drivers (installed via MTK Driver Auto Installer)
- π scatter.txt file from the firmware archive
Instructions:
- Unpack the firmware and find the scatter.txt file.
- Open the SP Flash Tool, click Choose and select scatter.txt.
- In the file list, find the recovery bar and specify the path to your twrp.img.
- Take off the boxes from all items except recovery!
- Turn off your phone without connecting it to your PC.
- In the SP Flash Tool, press Download and then connect the phone to the PC off.
- Wait for the green mug (OK) and turn off the device.
For TWRP inputs on MediaTek, use the Volume Up + Power combination (on some models β Volume Up + Down + Power).
-->
6. Common errors and their solution
Even with the exact following of the instructions, there can be problems.
| Mistake. | Reason. | Decision |
|---|---|---|
| Fastboot: unknown command | Older version of fastboot or the wrong way to files | Download fresh platform-tools from the Android site or check the path in the command line |
| Anti-Rollback (Error 7) | Trying to flash the old version of TWRP to a new firmware | Look for TWRP marked Anti-Rollback or roll back to old MIUI |
| The phone does not turn on after the firmware | Incompatible version of TWRP or interrupted process | Try logging into Fastboot (Loudness Down + Power) and flashing stock recavers through the Mi Flash Tool |
| Invalid sparse file format at header | The damaged twrp.img file | Download TWRP again (check the MD5 checksum) |
| TWRP is stitched, but reset to stock | Xiaomi blocks changes to the recovery section | After you have TWRP firmware, install Magisk or no-verity-opt-encrypt patch. |
If after installing TWRP, the phone boots in a bootloop, try:
- Sign in to TWRP and make Wipe β Format Data (this will delete all data!).
- I want to see Magisk (if you plan to root).
- Reboot to the system.
Models with Dynamic Partition (Xiaomi 12/13 Series, Redmi K50) may require manual partition resize via fastboot resize-logical-partition.It's a tricky procedure - if you're not sure, you'd better go to XDA or thematic chats.
7 What to do after installing TWRP
Successful TWRP installation is only half the battle.
- π Make a full backup (select Backup to the backup) TWRP and mark all sections: Boot, System, Data, EFS). Save a copy on the PC!
- π If you want root, go to Magisk. Magisk-vXX.X.zip. V TWRP Choose Install β Select a file β I'll send it back.
- π± Install Magisk Manager (or Magisk Delta for newer versions) to manage root rights.
- π‘οΈ Turn off forced encryption (if you plan to use custom firmware). disable_forceencrypt.zip.