How to flash Xiaomi on Android: a complete guide from unlocking to installing custom firmware

Firmware Xiaomi smartphones on pure or modified Android is a challenge faced by both experienced users and beginners who want to get rid of the branded shell MIUI. Despite the fact that MIUI offers rich functionality, many prefer stock Android for its speed, lack of advertising and more customization options. However, the process of firmware is fraught with risks, from loss of warranty to β€œbricking” the device if something goes wrong.

In this guide, we will analyze all the steps from preparing and unlocking the bootloader to choosing the right firmware (LineageOS, Pixel Experience, AOSP) and installing it through Fastboot or TWRP. We will pay special attention to the nuances for different Xiaomi models (for example, Redmi Note 10 Pro, Poco F3, Mi 11), and also tell you how to avoid typical errors. If you have never flashed your smartphones before, start by carefully studying each section, this will save you hours to correct the consequences.

1.Why are users stitching Xiaomi on pure Android?

The MIUI brand shell, despite its advantages, has a number of drawbacks that push Xiaomi owners to install alternative firmware:

  • πŸš€ Performance: Stock Android runs faster due to the absence of unnecessary background processes and optimizations from Xiaomi.
  • πŸ”’ Confidentiality: MIUI It collects more user data than stock Android (even with Google services).
  • πŸ“± Updates: Many custom firmware (like LineageOS) get security updates longer than Xiaomi supports its devices.
  • 🎨 Customization: the ability to fine-tune the interface, kernel and even replace standard applications.

But it’s not all that rosy: custom firmware can take away some MIUI features, like Game Turbo, branded gestures, or optimized camera performance, and banking apps like Sberbank Online or Tinkoff can block access on uncertified devices, and before you start, assess whether you’re ready for such trade-offs.

⚠️ Warning: The firmware of the device will void Xiaomi's warranty. If your smartphone is still warranty, weigh the pros and cons. Some service centers can restore the security. MIUI before repair, but it is not guaranteed.

πŸ“Š What kind of firmware do you plan to install?
LineageOS
Pixel Experience
AOSP (Pure Android)
MIUI Europa (modified)
Another.

2. Firmware Preparation: What to Do Before Starting

Incorrect preparation is the main cause of failed firmware. Before you start, follow the following steps:

  • πŸ“± Check the device model: go to Settings β†’ The phone. β†’ Make sure you download the firmware for your model (e.g. Redmi Note 9 Pro and Redmi Note). 9S β€” device!).
  • πŸ”‹ Charge the battery: the charge level should be at least 70%. The firmware can take up to an hour, and the discharge in the process will lead to a failure.
  • πŸ’Ύ Backup: Use Mi Cloud, Google Drive, or local copy on your PC!
  • πŸ–₯️ Install drivers: for Fastboot and ADB You need Xiaomi drivers (you can download on the official website).

Also prepare:

  • πŸ”Œ Cable USB Type-C (original or high-quality – cheap cables can interrupt the connection).
  • πŸ–±οΈ Computer on Windows 10/11 Linux (MacOS may require additional utilities).
  • πŸ“‚ Firmware and Tools (Platform Tools, Mi Flash Tool, TWRP).

Make sure the compatibility of the firmware and model|Download the official drivers Xiaomi|Charge your phone at least 70 times%|Create a backup copy of the data|Prepare the cable. USB Type-C-->

If you are flashing a device with MediaTek (like a Redmi 9A or Poco C31), the process may be different from the instructions for Qualcomm Snapdragon.

3. Unlocking the bootloader (Bootloader)

All Xiaomi smartphones have a locked bootloader by default. To install custom firmware, it must be unlocked. This process is officially supported by Xiaomi, but has its own nuances.

Steps to unlock:

  1. Link your Mi Account to your device: Go to Settings β†’ Xiaomi Account β†’ Link your account to your device.
  2. Activate Developer Mode: Go to Settings β†’ About Phone and click on MIUI Version 7 times.
  3. Enable OEM Unlock and USB Debugging in Settings β†’ Additional β†’ For Developers.
  4. Download the Mi Unlock Tool from the official website.
  5. Connect your phone to your PC in Fastboot mode (turn off the device, then press Volume Down + Power).
  6. Launch the Mi Unlock Tool, log in to your Mi Account and follow the instructions.

Important: Xiaomi introduces a waiting period (usually 7 days) before unlocking. This is a security measure to prevent users from accidentally unlocking the bootloader. If you see a message saying "Couldn't unlock. Wait for 168 hours" - it's OK. Wait for the specified time and try again.

⚠️ Warning: Unlocking the bootloader erases all data from the device, including photos, contacts and apps!

What if the Mi Unlock Tool can’t see the device?
1. Make sure the drivers are installed correctly (check in Device Manager). 2. Try another one. USB-port (preferably) USB Disable the antivirus – it can block the utility. 4. Reinstall the Mi Unlock Tool to another folder (for example, on the C: disk). 5. If you are using Windows 11, try running the utility in Windows 10 compatibility mode.

4. Selection of firmware: which one to install?

There are several types of firmware for Xiaomi, and each has its pros and cons. Here are the main options:

Type of firmwareAdvantagesDeficienciesSuitable for
LineageOSStock Android, frequent updates, high stabilitySome functions may not be supported (e.g. NFC)Users who need a clean Android
Pixel ExperienceGoogle Pixel interface, good optimizationSometimes there are bugs with the camera or sensors.Fans of the Google ecosystem
MIUI EuropaMIUI without advertising and Chinese services, stable operationNot as clean Android as custom firmwareThose who want to leave MIUI, but without any extra software
AOSP (e.g. Havoc-OS)Maximum customization, support for themes and modulesLess testing, possible bugsExperienced users who love to set up the system

For beginners, we recommend starting with LineageOS or Pixel Experience, which are the most stable and have a large community that will help in case of problems. Before downloading, check if your model is supported on the official firmware site (for example, LineageOS or Pixel Experience).

Xiaomi firmware based on MediaTek (Helio G-series, Dimensity) often has problems with support for custom Recovery. Before installing, check on forums (for example, 4PDA or XDA Developers) whether TWRP works for your model.

5. Install firmware via Fastboot (official method)

The most reliable way to flash Xiaomi is to use the Fastboot mode and the official Mi Flash Tool, which is suitable for installing both stock MIUI and some custom firmware (if provided in.tgz or.zip format for Fastboot).

Step-by-step:

  1. Download the firmware in Fastboot format (for example, from the Xiaomi Firmware Updater website).
  2. Unpack the archive in a folder without Cyrillic characters (for example, C:\Xiaomi\fastboot_rom).
  3. Install the Mi Flash Tool and run it on behalf of the administrator.
  4. Connect your phone in Fastboot mode (clip Volume Down + Power when the device is off).
  5. In the Mi Flash Tool, click Select and select the folder with the firmware.
  6. Select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader After Firmware).
  7. Press Flash and wait until it is completed (usually 5-10 minutes).

Once the firmware is successful, the device will automatically restart. The first run can take up to 15 minutes - don't interrupt the process!

⚠️ Note: If you are flashing a device with a locked bootloader (for example, after selecting Clean all and lock), you will have to unlock Bootloader again and wait 168 hours to re-install custom firmware.

πŸ’‘

If the Mi Flash Tool gives you a β€œcan’t find fastboot” error, try running it in Windows 7 compatibility mode or temporarily disable the driver digital signature check in Windows.

6. Installation via TWRP (for custom firmware)

Most custom firmware (LineageOS, Pixel Experience) requires custom TWRP recavers. This method is more flexible, but also more risky - installation errors can lead to the failure of the device.

Steps to install via TWRP:

  1. Download TWRP for your model from the official twrp.me website or trusted sources (e.g. 4PDA).
  2. Install. TWRP Fastboot: Fastboot Flash Recovery twrp-3.7.0_9-0-joyeuse.img fastboot boot twrp-3.7.0_9-0-joyeuse.img
  3. In TWRP, run Wipe β†’ Advanced Wipe and mark Dalvik, Cache, System, Data.
  4. Transfer the firmware to your phone (via MTP to TWRP or with ADB Sideload).
  5. Install the firmware: Install β†’ Select the file β†’ Swipe to confirm.
  6. After installing the firmware, it is recommended to flash Gapps (Google services) and Magisk (for root rights), if they are needed.

If after installation the device is stuck on the logo, try:

  • πŸ”„ Refresh the firmware.
  • πŸ“¦ Install a different version of Gapps (e.g. NikGapps instead of OpenGapps).
  • πŸ”§ Check firmware compatibility with your model in the forum.

πŸ’‘

Installing via TWRP requires pre-unlocking the bootloader. If you missed this step, the device won't boot into the Recovery.

7.Typical errors and their solutions

Even with the correct instructions, errors can occur, and here are the most common ones and how to correct them:

Mistake.Possible causeDecision
Error: Failed to boot into fastbootdIncompatible version of Mi Flash Tool or driversUpdate the utility and drivers, try another USB-port
This package is for "joyeuse" devices; this is a "joyeuse".The firmware is not suitable for your model.Check the firmware name and device model
The device does not turn on after firmwareIncorrectly selected firmware version or installation errorTry flashing stock MIUI through Fastboot
E: Unknown command [log] in TWRPDamaged Recavery or Incompatible FirmwareReinstall TWRP or try another version

If your device is no longer on (brick), don't panic. In most cases, it can be restored:

  1. Try going to Fastboot (click Volume Down + Power).
  2. If the device is defined as Qualcomm HS-USB QDLoader 9008, use it. EDL-Mode and run the stock firmware through the Mi Flash Tool.
  3. Check out the 4PDA or XDA forums, and there are recovery guides for specific models.

8. What to do after the firmware?

After successful firmware installation, follow a few important steps:

  • πŸ”„ Set up the system: go through the initial setup, connect your Google account and restore data from the backup.
  • πŸ”’ Check security: If you installed Magisk, hide root rights for banking applications (for example, through MagiskHide).
  • πŸ“± Update the firmware: many custom firmware supports OTA-Update. Check them in Settings. β†’ System system β†’ Update.
  • πŸ”§ Install additional modules: if necessary ViPER4Android (For sound, or GCam (for improved camera), do it after the first boot.

If you encounter bugs (such as NFC or Wi-Fi not working), check:

  • πŸ“‹ Compatibility of the firmware with your model on the official website.
  • πŸ”„ Availability of updates for firmware or kernel.
  • πŸ’¬ Reviews of other users on forums (possibly the problem is known and there is a solution).

πŸ’‘

If your gestures or touch buttons stop working after firmware, try calibrating the screen through the engineering menu (#36446337## for some models).

FAQ: Frequent questions about Xiaomi firmware

Can I use Xiaomi without unlocking the bootloader?
No, custom firmware installation is mandatory, but you can upgrade your stock MIUI via Recovery or Fastboot without unlocking if the firmware is official.
How to return stock MIUI after installing custom firmware?
Download the official firmware for your model in Fastboot format and run it through the Mi Flash Tool, select Clean all mode.
Why is the mobile network not working after the firmware?
This may be due to the lack of modem files in custom firmware. Try flashing stock modem through Fastboot or installing firmware with support for your region.
Can I get a root right on Xiaomi without firmware?
Yes, with Magisk. You have to unlock the bootloader, install Magisk over TWRP, or patch boot.img manually, but that also voids the warranty.
What Xiaomi models can’t be flashed on pure Android?
Technically, you can flash any device, but for some models (for example, Xiaomi 12T or Redmi Note 12 Pro+) there may not be stable custom firmware due to new hardware or closed source drivers.