Installing custom firmware on Xiaomi smartphones is one of the most popular ways to unlock the hidden potential of a device. With TWRP (Team Win Recovery Project), you can flash an alternative version of MIUI, LineageOS, Pixel Experience or other firmware, gaining access to new features, improved performance and current security updates. However, the process requires caution: error at any stage β from unlocking the bootloader to choosing the wrong firmware β can turn the smartphone into a brick.
In this guide, we will break through the whole process from A to Z: how to unlock a bootloader through the Mi Unlock Tool, install TWRP without errors, find a compatible firmware for your Xiaomi model (be it Redmi Note 10 Pro, POCO X3 or Mi 11), and successfully sew it through. We will focus on typical problems β for example, why Wi-Fi or NFC does not work after firmware, and how to fix them. If you are a beginner, donβt be afraid: each step is accompanied by screenshots (in text format) and explanations.
Warning: The procedure resets all data on the device, including photos, contacts and apps, and it can also take away the official warranty (if the device was purchased less than a year ago).
1.Preparation: What to do before installing TWRP
Before you start unlocking the bootloader and installing the custom recavator, you need to follow several critical steps, skipping at least one of which can lead to the inability to restore the device or loss of data.
First, check your Xiaomi model. To do this, go to Settings β About Phone β Device Model. Write down the exact name (e.g. Redmi Note 9 Pro is joyeuse, and POCO F3 is alioth). This information will be needed to download the correct version of TWRP and firmware.
- π± Create a backup of all data (photos, videos, contacts, SMS) via Mi Cloud, Google Drive or locally on your PC. Once the bootloader is unlocked, the device will be completely reset.
- π Charge the battery to at least 70%. interruption of the process due to battery discharge can make the smartphone inoperable.
- π» Install drivers for your Xiaomi on your PC. Download them from the official Xiaomi website or use the universal Mi package PC Suite.
- π Put the debugging on. USB In the developer settings. Go to Settings for that. β About the phone, tap 7 times on the version MIUI, Then go back to the settings. β Additionally. β For developers and activate debugging by USB.
Also make sure your PC has ADB and Fastboot installed. If not, download Platform Tools from Android Developers and unpack the archive at the root of the C:\ drive.
β οΈ Note: If your device was purchased in China (suffix version) CN), Unlocking the bootloader can take up to 360 hours (15 days) of waiting. (Global) versions typically take 72 hours.
2 Unlock the Xiaomi bootloader via Mi Unlock Tool
The bootloader on Xiaomi smartphones is blocked by default. To install TWRP and custom firmware, it must be unlocked using the official Mi Unlock Tool.
Download the utility from the Xiaomi website (select the version for your OS) and follow the following steps:
- Log in to Mi Account on your phone and link it to your device in Settings β Xiaomi Account.
- Connect your smartphone to your PC in Fastboot mode (turn off the device, then press Volume down + Power until the hare appears in the eardress cap).
- Launch the Mi Unlock Tool on your PC, sign in under the same Mi Account and follow the program instructions.
- If you get a wait message (e.g., Wait 168 hours), wait until the deadline expires.
Once successfully unlocked, the device will automatically reset to factory settings, and you can now start installing TWRP.
3. Installation of TWRP Recovery on Xiaomi
Now that the bootloader is unlocked, it's time to install a custom recaveri. TWRP It will allow you to create backups, to sew ZIP-files and manage memory partitions.
Download the current version of TWRP for your model from the official website twrp.me (see the code of the device, for example, raphael for Redmi K20 Pro).
Follow the commands in Fastboot:
fastboot flash recovery twrp-3.7.0_12-0-raphael.img
fastboot reboot recoveryIf after rebooting the system in TWRP offers to enter a password (due to data encryption), execute Format Data (this will delete all data, but unlock access).
β οΈ Note: Some Xiaomi models (such as the Redmi Note 8 Pro with Mediatek chipset) require additional manipulations to unlock Anti-Rollback.Ignoring this step can lead to hard-brick (irreparable damage).
Download the correct.img file for your model|Device in Fastboot mode|ADB Fastboot is installed on PC|Battery charged. >70%|Data backup made.-->
4. Selection and downloading of custom firmware
The stability of the device depends on the choice of firmware. Here are the main options for Xiaomi:
| Type of firmware | Advantages | Deficiencies | Recommended models |
|---|---|---|---|
| Castom MIUI (xiaomi.eu, MIUIMix) | Maximum optimization for Xiaomi, no camera/NFC bugs | Closed source code, limited customization | All models. |
| LineageOS | Clean Android, Regular Security Updates | Branded chips (IR-blaster, Game Turbo) may not work | POCO F1, Mi A2, Redmi Note 7 |
| Pixel Experience | Google Pixel interface, Google Camera support | Sometimes lays on weak chipsets | Redmi Note 8 Pro, Mi 9T |
| Havoc OS | Maximum customization (themes, gestures, statusbar) | Less stability than LineageOS | POCO X3, Redmi K20 |
Download the firmware only from verified sources:
- π xiaomi.eu - custom MIUI bloatless;
- π± LineageOS - official builds;
- πΈ Pixel Experience β firmware with Pixel interface;
- π§ XDA Developers β firmware from the community (look for the theme of your model).
Note the firmware version of Android. For example, if your device officially supports Android 12, donβt install firmware on Android 13, which can cause problems with the Wi-Fi or Bluetooth module.
π‘
Before you run your firmware, check the reviews on the forums for your chosen build. If in the latest comments, users complain about a fast battery drain or overheating, you better look for another version.
5. Step-by-step installation of custom firmware through TWRP
Now, to the most important stage, firmware, follow the instructions carefully.
- Copy the firmware on your phone. Connect the device to your PC in mode. MTP (into TWRP Choose Mount β Enable MTP) and move ZIP-firmware file into internal memory.
- Backup the current system. TWRP Go to Backup and select Boot, System, Data. Save backup to Backup. SD-card.
- Go to Wipe β Advanced Wipe and mark Dalvik/ART Cache, System, Data, Cache. Swipe for confirmation.
- Install the firmware. Press Install, select. ZIP-For some firmware (for example, LineageOS) you will need to additionally flash GApps (Google services).
- If you want root access, download Magisk from GitHub and install it via TWRP after you have firmware.
- Reboot. Press Reboot System. It can take 10 to 15 minutes to boot first -- don't interrupt.
If after the reboot the device stuck on the logo or went into a bootloop (cyclic reboot), go back to TWRP (clip Volume Up + Power) and:
- Repeat the firmware by pre-formatting the Data;
- Try another firmware assembly;
- Restore the backup (if you have).
What happens if TWRP is not installed?
6.Typical problems after firmware and their solution
Even if the firmware is successful, you may encounter bugs, and here are the most common ones and how to fix them:
| Problem. | Possible cause | Decision |
|---|---|---|
| Wi-Fi/Bluetooth is not working | There is no branded driver WCNSS_qcom.cfg | Sweat the patch for your model or go back to stock firmware |
| Camera makes a mistake | No Libarcore or Google Camera incompatible | Install. ANX Camera or patch the patch Fix_Camera.zip |
| Fast battery discharge | Background processes of custom firmware or unoptimized core | Calibrate the battery in TWRP or run through another core |
| NFC's not working | There is no proprietary NFC module in the firmware | Switch stock vendor.img through TWRP |
If Xiaomi's signature chips (like Game Turbo or Second Space) are no longer working after LineageOS or Pixel Experience firmware, this is normal. These functions depend on closed MIUI components, and they don't work in AOSP-based firmware.
β οΈ Warning: If the device doesn't turn on after the firmware is installed (black screen, no button response), don't panic. Connect it to your PC and check if it's detected by the fastboot device command in Fastboot. If so, try flashing the stock firmware through the Mi Flash Tool.
7 How to return the stock firmware if something went wrong
If custom firmware is unstable or you want to return the official MIUI, do the following:
- Download the stock firmware for your model from Xiaomi. Choose the Fastboot version (.tgz extension).
- Unpack the archive in a folder on your PC.
- Put the device in Fastboot mode (Loudness down + Power).
- Run the Mi Flash Tool, select the firmware folder, and press Refresh. The device must be determined.
- Select Clean All mode and press Flash.
After successful firmware, the device will reboot to the stock MIUI. The bootloader will remain unlocked, but you can lock it again via the Mi Unlock Tool (Lock option).
If the Mi Flash Tool is an anti-rollback error, you are trying to flash an older version of MIUI than the one you installed earlier, in which case you will have to look for firmware with the same or newer Anti-Rollback number.
π‘
Always check the Anti-Rollback version before running stockware MIUI. You can find it in the name of the firmware file (for example, V12.5.1.0.RJWMIXM_anti3 β here anti3).