Why would you want to use Xiaomi on TWRP?
The firmware of Xiaomiβs smartphone via TWRP (Team Win Recovery Project) provides access to custom firmware, cores and mods that are not in the official MIUI updates. This is the only way to install LineageOS, Pixel Experience or Havoc-OS on devices with a locked bootloader from the manufacturer. But the process requires care: a mistake at any stage can turn the phone into a βbrickβ.
Unlike the standard upgrade via Settings β About Phone β System Update, TWRP firmware gives you full control over system partitions. You can remove Xiaomi's built-in apps (bloat), change the CPU frequency, or even install Google Camera with full support for all camera modules, but you have to unlock the bootloader, which resets the phone to factory settings and voids the warranty.
This instruction will be suitable for most Xiaomi, Redmi and POCO models released after 2018 (for example, Redmi Note 10 Pro, Xiaomi 12T, POCO F4). For older devices (before Xiaomi Mi 8), the process may be different β they have a different mechanism for unlocking the bootloader.
Preparation: What is needed before the firmware?
Before you start, make sure you have:
- π Charged smartphone (at least 70% battery) firmware can take up to 30 minutes, and discharging in the process will lead to failure.
- π» Windows computer 10/11 Linux (MacOS will require additional drivers).
- π Cable USB Type-C (original or certified) Cheap cables may not transmit data to fastboot.
- π Backup data. Firmware through TWRP format /data and /system.
Also check your device model in Settings β About Phone β Model. For example, the Redmi Note 11 Pro+ 5G has the code name veux, and the Xiaomi 13 is fuxi. This is necessary for downloading the correct version of TWRP and firmware.
β οΈ Note: If your device is purchased in China (suffix version) CN in the model), firmware global version MIUI It can block the network. Check compatibility on the forum. XDA Developers.
Step 1: Unlocking the Xiaomi bootloader
The Xiaomi bootloader is locked by default. To unlock it, you need to get permission from the manufacturer through the official Mi Unlock Tool tool.
- Download Mi Unlock Tool from the official Xiaomi website (Windows version).
- Turn on the phone Developer Mode: go to Settings β About Phone and 7 times click on the MIUI version.
- Back to Settings β Additionally. β For developers and activate: π Unlocking OEM (may be required PIN-code). π Debugging by USB.
Connect your phone to your PC, launch the Mi Unlock Tool, and log in to your Mi Account (it should be linked to the device).
Follow the instructions of the program. Unlocking will take 72-168 hours (depending on Xiaomi policy).
Once successfully unlocked, the phone will automatically reset to factory settings.Do not disconnect the device from the PC during the process - this can lead to a permanent lockdown of the bootloader.
Linked to Mi Account |
USB| debugging enabled
Installed drivers ADB/Fastboot|
Data backup |
Battery charge > 70%-->
Step 2: Installation of TWRP Recovery
Once you unlock the bootloader, you can install TWRP. This customized Recovery will allow you to sew informal firmware and make backups.
Download the current version of TWRP for your model from twrp.me (see device code, for example, alioth for POCO F3).
- Move the downloaded file twrp-3.7.0_12-0-alioth.img To the folder with platform-tools (from Android) SDK).
- Open the command line (Win + R β cmd) and go to the folder with platform-tools: cd C:\platform-tools
- Turn off the phone and press Volume Down + Power to log into the Fastboot.
- Connect the phone to your PC and check the connection with the command: fastboot devices If the device is determined (the serial number will appear), continue.
- Please. TWRP Team: Fastboot Flash Recovery twrp-3.7.0_12-0-alioth.img
- After successful firmware reboot to recavator: fastboot boot twrp-3.7.0_12-0-alioth.img
β οΈ Note: On some models (Xiaomi) 12/13 series, Redmi K50) post-fix TWRP The system can automatically restore the stock Recovery, so to avoid this, immediately after entering the receptacle. TWRP Go to Advanced. β Flash Current TWRP.
π‘
If the fastboot device command doesnβt show your device, install Google USB Driver drivers or use the Mi Flash Tool to install it automatically.
Step 3: Creating a backup in TWRP
Before you run the firmware, make sure to back up your current system, which will save your data if something goes wrong.
- In TWRP, go to the Backup section.
- Select the backup sections: π Boot (Boot section). π System (system partition). π Data (user data). π Vendor (firmware of the supplier).
Press Select Storage and select Micro SD Card or USB OTG (if the backup on internal memory, it will disappear after formatting).
Swipe to start the backup. It can take 10 to 30 minutes.
Backup files will be saved in the TWRP/BACKUPS folder. Copy them to the PC or cloud - they will come in handy if the firmware ends in an error.
| Section | What it keeps. | Should I backup? |
|---|---|---|
| Boot | The kernel and boot files | β Yes. |
| System | OS and pre-installed annexes | β Yes. |
| Data | Photos, messages, settings | β Yes. |
| Vendor | Module drivers and firmware | β οΈ Only if you're casting a caste. |
| EFS | IMEI and network settings | β I'll be sure! |
Step 4: Firmware through TWRP
Now you can install firmware. To do this, download the appropriate.zip file:
- π± Official. MIUI (for example, MIUI 14) β from en.miui.com.
- π οΈ Brush firmware (LineageOS, ArrowOS) β from the forum XDA Developers.
- π§Ή Firmware without bloat - look for xiaomi.eu (version) MIUI EU).
Installation instructions:
- Copy the firmware file (miui_VEUX_14.0.5.0.zip) phone-drive.
- V TWRP press Wipe β Advanced Wipe and mark: π§Ή Dalvik / ART Cache π§Ή System π§Ή Data (if you need a clean installation) π§Ή Cache
Swipe for confirmation.
Go back to the main menu and select Install. Specify the path to the firmware file.
In addition:
- π§ If you do. MIUI, Check the Zip file signature verification box).
- π§ Custom firmware may need to flash GApps (Google services) separately.
- Swipe to start the installation. It'll take 5-15 minutes.
- After completion, press Reboot System.
What to do if the firmware is hung on the logo?
Step 5: Solving Common Mistakes
Firmware through TWRP doesn't always go smoothly. Here are the most common problems and solutions:
| Mistake. | Reason. | Decision |
|---|---|---|
| Error 7 when installed | Incompatible firmware or the wrong model | Check the code name of the device and download the correct version. |
| Hanging on to Mi Logo | Incorrect vendor or no firmware | Run a stock vendor or run a Format Data |
| Failed to mount /data | Encrypted data section | In TWRP, select Wipe β Format Data β Yes |
| Fastboot mode after rebooting | Boot or recovery damaged | Re-flash the TWRP and re-install |
If the IMEI is missing after the firmware or the network is not working, then the EFS partition is damaged. Restore it from the backup or use the QCN Rebuilder tool (requires root).
π‘
90% of firmware errors are due to the wrong firmware version or the missing Format Data step. Always check the compatibility of files with your model!
Step 6: Optimization after firmware
After successful installation of the firmware:
- β‘ Restart your phone and wait for full app optimization (can take up to 10 minutes).
- π If you have been flashing custom OS (LineageOS), install Magisk for root rights: 1. Download. Magisk.zip GitHub 2. V TWRP Choose Install β Magisk.zip 3. Reboot.
- π‘ To improve autonomy, disable unnecessary Xiaomi services:
- π If you use MIUI, Turn off the adverts: Settings β Memory. β Cleanup β Settings (cogs) β Delete "Recommendations"
To check the stability of the firmware, use the tests:
- π AnTuTu Benchmark β for performance assessment.
- π AccuBattery β to monitor battery consumption.
- πΆ Network Signal Guru β for checking the connection.