Reinstall Android on Xiaomi: a full guide with unlocking the bootloader and selecting firmware

Reinstallation of the operating system on Xiaomi smartphones is a procedure that can be required in case of critical failures, wanting to upgrade an outdated version of MIUI or switch to a clean Android. Unlike a conventional factory reset, full flashing allows you to eliminate deep software errors, remove viruses that have penetrated system files, or even bring back to life the β€œbrick” after a failed update. However, this process requires accuracy: wrong actions can turn your Redmi Note 12 or POCO X5 into a useless piece of plastic.

In this article, we will discuss all the official and informal ways to reinstall Android on Xiaomi devices, including unlocking the bootloader, choosing the right firmware (stable/global/castom), and recovering data after the procedure. We will pay special attention to the nuances for different models, from the budget Redmi A2 to the flagship Xiaomi 14 Ultra. If you have never done firmware before, start with the official method through the Mi Flash Tool - it is the safest, although it requires waiting for the bootloader to unlock.

1.Reinstallation Preparation: What to Do Before Firmware

Before you start flashing, be sure to check the compatibility of the selected firmware with your Xiaomi model by device code (for example, toco for the device). POCO X3 Pro or cupid for Xiaomi 13. Installing incompatible software will cause the smartphone to fail. β†’ The phone. β†’ Model or on a sticker under the slot cover SIM-map.

Also prepare:

  • πŸ”‹ Battery charge of at least 60% (when discharged during firmware, the device can turn into a β€œbrick").
  • πŸ’» Windows computer 7/10/11 (The Mi Flash Tool is required for Windows).
  • πŸ”Œ Original. USB-cable (cheap cables can interrupt data transmission).
  • πŸ“ Backup of important data (firmware completely erases internal memory!).

⚠️ Note: If your Xiaomi was purchased in China, it is likely that it is running regional firmware without support for Google services. MTK-Check compatibility in advance on the forum Xiaomi.eu.

For backup, use:

  • πŸ“² Built-in Settings function β†’ Additionally. β†’ Backup and reset (keeps contacts, SMS, setting).
  • πŸ–₯️ Mi programme PC Suite (copy photos, videos, applications).
  • ☁️ Cloud services (Google Drive, Mi Cloud) for documents.
πŸ“Š What Xiaomi model are you going to use?
Redmi Note 12/13
POCO X5/F5
Xiaomi 13/14
Redmi A2/A3
Another model

2 Unlocking the bootloader (Bootloader) - a mandatory step

All modern Xiaomi smartphones come with a locked bootloader, meaning you won’t be able to install custom firmware or even official firmware through Fastboot until you unlock it.The procedure takes 3 to 7 days (depending on Xiaomi’s policy) and requires you to link your Mi Account to the device.

Step-by-step:

  1. Activate Developer Mode: Go to Settings β†’ About Phone and click on MIUI Version 7 times.
  2. Back to Settings β†’ Additionally. β†’ For developers and include: πŸ”“ Unlocking OEM (may require input PIN-code). πŸ”Œ Debugging by USB.

Mi Unlock Tool

Mi

Fastboot

Food + Volume Down

Unlock

⚠️ Warning: Once the bootloader is unlocked, the smartphone will perform a full reset (wipe). All data will be deleted! Also, some banking applications (for example, Sberbank Online) may stop working due to a trigger. OEM Unlock is secure in Android.

What if the Mi Unlock Tool can’t see the device?
1.Make sure Qualcomm drivers are installed HS-USB QDLoader 9008 (can be downloaded from the XDA Developers). 2. Try another one. USB-port (preferably) USB 2.0). 3. Disable the antivirus - it can block the utility.

3. Selection of firmware: official vs custom

The type of firmware depends on the stability of work, the availability of Google services and even battery life.

Type of firmwareAdvantagesDeficienciesWho's right for?
Official Stable (Global/EEA)Maximum compatibility, support for OTA updates, all functions workLots of Bloatware (pre-installed Xiaomi apps), slow updatesFor those who want stability
Official Development (Beta)New features before everyone else, less BloatwareBugs, unstable work, possible problems with the batteryEnthusiasts Ready for the Bugs
Xiaomi.euClean MIUI without Chinese apps, weekly updatesNo official support, camera/NFC bugs are possibleAdvanced users
LineageOS (Pixel Experience)Clean Android, long-term support, no BloatwareCamera, NFC, Widevine L1 (no Netflix in HD) may not workGycs who want a stock Android

For most users, the best choice is the official global firmware (for example, V14.0.3.0.TMCEUXM for Xiaomi 13). It can be downloaded from the site en.miui.com. If you need firmware without unnecessary applications, pay attention to Xiaomi.eu - a modified version of MIUI with remote bloatware and added support for the themes of design.

πŸ’‘

Before downloading the firmware, check its hash amount (MD5) using the HashMyFiles utility. This will save you from installing a corrupt file that can "brick" the device.

4. Ways to reinstall Android on Xiaomi

There are three main firmware methods, each suitable for different situations:

4.1. via Mi Flash Tool (Fastboot)

The most reliable way to get official firmware is if:

  • πŸ“± The device does not turn on or is stuck on the Mi logo.
  • πŸ”„ I need to return the stock firmware after the custom.
  • πŸ”§ Requires a complete reinstallation with the removal of all data.

Instructions:

  1. Download the Mi Flash Tool and unpack the firmware into a folder without Cyrillic characters.
  2. Start the phone in Fastboot mode (Power + Volume Down).
  3. In the program, click Select, specify the path to the folder with the firmware, then Refresh (the device should appear).
  4. Choose Clean All or Clean All and Lock (if you want to lock the bootloader again).
  5. Press Flash and wait until it is completed (10-15 minutes).

4.2. Through Recovery (TWRP)

This method allows you to install custom firmware (for example, LineageOS) or make backups through TWRP.

  • πŸ› οΈ Installation of modified versions MIUI (Xiaomi.eu).
  • πŸ”„ Updates without loss of data (if firmware is compatible).
  • πŸ“¦ Backups of the section /data.

To install TWRP:

  1. Download the recovery image for your model from twrp.me.
  2. Rename the file to twrp.img and place it in the folder with the platform-tools (from the Android SDK).
  3. Run command: fastboot flash recovery twrp.img fastboot boot twrp.img
  4. In TWRP, select Wipe β†’ Format Data (if you want a clean installation), then Install and specify the firmware file.

Through OTA (Air Update)

The easiest way, but it only works for official updates: If your Xiaomi is switched on and connected to the Internet, check for updates in Settings β†’ About Phone β†’ System Update. This method does not require unlocking the bootloader and saves all data.

β˜‘οΈ Preparation for firmware through Mi Flash Tool

Done: 0 / 5

5. Typical errors and their solutions

Even if you follow the instructions, you can have problems, and here are the most common mistakes and ways to fix them:

Mistake.Reason.Decision
Couldn't unlock the Mi Unlock ToolIt has not been 7 days since the account was linked.Wait until the time is set or try another Mi Account.
Fastboot not recognizedNo drivers or wrong path to platform-tools installedInstall Android SDK or add path to adb in environment variables
The device does not turn on after firmwareIncompatible firmware or interrupted processRepeat the firmware through Fastboot with the choice of Clean all
Anti-rollback errorTrying to roll back to an older version of MIUIOnly re-read the new version (no retracement possible).

If Xiaomi does not load beyond the logo after the firmware, try:

  1. Press Power + Volume up to log into Recovery and make Wipe data.
  2. Fastboot with a clean all and lock check.
  3. If nothing helps, contact the service center (possibly damaged). EMMC-chip).

πŸ’‘

Never interrupt the firmware process during the writing phase of the system or boot partition, and this is guaranteed to lead to a build-up of the device that can only be restored through the system or boot partition. EDL-Mode (requires an authorized Xiaomi account).

6. Data recovery after reinstallation

If you made a backup through Mi PC Suite or TWRP, you can restore data in a few steps:

For TWRP:

  1. Copy the backup file (TWRP folder) to your phone.
  2. Download to TWRP and select Restore.
  3. Check the Data and Internal Storage sections (do not restore Boot or System!).
  4. Confirm the recovery and wait for completion.

For the Google account:

  • πŸ“± When first enabled after firmware, select Restore from backup and log in.
  • ☁️ Contacts, calendar and some app settings will be restored automatically.
  • πŸ“· Photos and videos can be downloaded from Google Photos (if sync is enabled).

⚠️ Note: If you restore data from the backup to custom firmware (for example, LineageOS), some system applications (Mi Gallery, Mi Music) may not work.

7. System optimization after flashing

To make your Xiaomi work faster and keep your charge longer after reinstalling Android, do a few optimizations:

For the official MIUI:

  • πŸš€ Turn off animation: in Settings β†’ Additionally. β†’ For developers, set the animation scale on the off..
  • πŸ”‹ Limit background activity: Settings β†’ Battery β†’ Optimizing the battery β†’ Choose Strict for Unnecessary Apps.
  • πŸ—‘οΈ Remove Bloatware through ADB: adb shell pm uninstall -k --user 0 com.miui.analytics

For custom firmware (LineageOS, Pixel Experience):

  • 🎨 Install Magisk for root rights and modules (e.g, ViPER4Android sound-enhancing).
  • πŸ”’ Set SELinux to Permissive Mode (if you have problems with modules).
  • πŸ”„ Regularly update the firmware through OTA or manually (castomy firmware gets security patches more often than MIUI).
adb shell pm disable-user --user 0 com.miui.systemAdSolution

This will remove ads from system applications.-->

FAQ: Frequent questions about reinstalling Android on Xiaomi

❓ Can I reinstall Android without unlocking the bootloader?
No, for a full Fastboot flash or custom Recovery install, unlocking is mandatory.The only exception is an update via OTA (if the device is turned on) or firmware via EDL (requires an authorized Xiaomi account).
❓ How to return the official firmware after custom?
Download the official firmware for your model from Xiaomi, then thread it through the Mi Flash Tool with the Clean all and lock option. This will block the bootloader and return the stock MIUI. Please note that all data will be deleted!
❓ Why does the mobile network not work after the firmware?
This is a problem that is common in Chinese models (China). ROM), Solutions: Check if your model supports global firmware (e.g. Redmi Note 11 Pro)+ 5G Install the firmware Xiaomi.eu β€” it is often better adapted for non-Chinese SIM-Manually write it. APN-settings of your operator in the settings β†’ SIM-maps and mobile networks β†’ Access points (APN).
❓ Can you flash Xiaomi on pure Android without MIUI?
Yes, but with reservations: πŸ“± Most models have LineageOS, Pixel Experience or ArrowOS ports. ⚠️ Some devices (especially MediaTek processors) may not have a camera, NFC Widevine L1 (No Netflix in the world HD). πŸ”§ Requires an unlocked boot loader and installation TWRP. Before installing, check the firmware reviews for your model on the forum XDA Developers.
❓ How to avoid β€œbricking” when firmware?
Follow these rules: πŸ” Always check firmware compatibility with your model code (e.g., vili for Xiaomi 12 Pro). πŸ”Œ Use the original. USB-cable USB 2.0 (USB 3.0 can cause transmission errors). ⏳ Do not interrupt the firmware process (even if it is 99% frozen, wait 10-15 minutes). πŸ“‘ When you run your firmware through Fastboot, turn off Wi-Fi and antivirus on your PC. If the device still "bursts", try flashing it into a computer. EDL-Registration (requires authorization from Xiaomi).