How to completely reinstall Android on Xiaomi smartphone: a step-by-step guide

Reinstallation of the operating system on Xiaomi smartphones can be required in a variety of situations, from bugs after an upgrade to a complete cleaning of the device before sale. Unlike a normal reset, a full flashing allows you to install a clean version of Android from scratch, eliminating system errors, removing viruses or even changing the firmware region. However, the process requires care - wrong actions can turn the phone into a brick.

In this article, we will discuss all the steps from device preparation to installation method selection (via Fastboot or Recovery), focus on the nuances for different Xiaomi models, including the Redmi Note 12, POCO X5 and the flagship Mi 13 series. You will also learn how to avoid common mistakes, such as losing IMEI or blocking your Mi Account after firmware.

Before you start, answer the main question: why do you need to reinstall Android? If the goal is just to clean your phone of garbage, maybe enough resetting through Settings โ†’ Phone โ†’ Reset. Flashing is only needed for deep system changes, install custom firmware or recover from serious crashes.

๐Ÿ“Š Why do you want to re-examine Xiaomi?
Eliminate bugs and lags
Install global firmware
Install custom firmware (LineageOS, Pixel Experience)
Restore the phone after a failure
Another option

1. Preparing the phone for flashing

The first and most important step is data backup, and reinstalling Android will remove all information from internal memory, including:

  • ๐Ÿ“ฑ Contacts (unless synced with Google or Mi Cloud)
  • ๐Ÿ“ท Photos and videos in the gallery (including screenshots and downloads)
  • ๐ŸŽต Music, documents and files in the Download folder
  • ๐Ÿ”‘ Wi-Fi passwords, data stored in the browser
  • ๐ŸŽฎ Game saving (if not linked to an account)

For backup, use:

  • ๐Ÿ–ฅ๏ธ Mi PC Suite (Official Software from Xiaomi for Windows)
  • โ˜๏ธ Cloud services: Google Drive, Mi Cloud or Yandex Disk
  • ๐Ÿ“ Manual copying to a computer via cable USB Type-C

โš ๏ธ Note: If your phone is locked with a pattern lock or password and you donโ€™t remember your Mi Account details, flashing it will not unlock the device).

Also check:

  • ๐Ÿ”‹ Battery charge (at least 50%)
  • ๐Ÿ”Œ The original cable. USB (Cheap cables can interrupt the connection)
  • ๐Ÿ’ป Windows computer 7/10/11 (for the Fastboot method)

โ˜‘๏ธ Checklist before firmware

Done: 0 / 5

2 Unlocking the bootloader (Bootloader)

Without unlocking the bootloader, you canโ€™t reinstall Android on Xiaomi, which is protection against unauthorized system changes, taking 3 to 15 days (depending on Xiaomiโ€™s policy) and requires:

  1. A phone-linked Mi Account (with a confirmed phone number!)
  2. Developer mode enabled and USB debugging allowed.
  3. Mi Unlock Tool (you can download from the official website).

Instructions for unlocking:

  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 (It may be called a factory unlock) ๐Ÿ”Œ Debugging by USB

Mi Unlock Tool

Mi Account

Fastboot

Fastboot

โš ๏ธ Warning: If you bought your phone with your hands, make sure the previous owner untie their Mi Account. Otherwise, after unlocking the bootloader, the device may be tied to someone else's account and you will not be able to use it.

Once successfully unlocked, the bootloader will remain unlocked even after flashing, but some official firmware (such as the Xiaomi 13 Ultra) can automatically block it when installed, in which case the procedure will have to be repeated.

What happens if you flash a phone with a locked bootloader?
The phone will not boot into the system and will constantly reboot to Fastboot mode. This can only be corrected by unlocking the bootloader or installing the original firmware through an authorized service center.

3. Selection of firmware: official vs custom

The type of firmware that determines the stability of the phone, the availability of updates and even the guarantee.

Type of firmwarePlusesConsFor which models?
Official MIUI (Global/EEA/China)โœ… Stable work โœ… Support OTG-update โœ… Preservation of the guaranteeโŒ Many pre-installed applications โŒ Advertising in system utilities โŒ Restrictions by region (for example, no Google on Chinese firmware)All models Xiaomi/Redmi/POCO
Castom (LineageOS, Pixel Experience, crDroid)โœ… Clean Android without Bloatware โœ… Quick security updates โœ… Advanced settingsโŒ Possible bugs with camera or sensors โŒ No official support โŒ Loss of guaranteePOCO F3, Redmi Note 10 Pro, Mi 11 (popular models)
Port from other devices (for example, firmware from POCO to Redmi)โœ… Unique featuresโŒ High risk of โ€œbricking" โŒ Failing modules (NFC, 5G)Only for experienced users

Where to download the firmware:

  • ๐ŸŒ Official firmware MIUI: https://new.c.mi.com/global/miuidownload/index
  • ๐Ÿ› ๏ธ Custom firmware: XDA Developers or SourceForge
  • ๐Ÿ” To search by model: use the Device filter: [name of your model] on XDA.

Critically, the firmware must match the phone model and the bootloader version (e.g., Redmi Note 11 Pro 5G and Redmi Note 11 Pro are different devices!) Installing incompatible firmware will result in loss of IMEI or failure of the communication module.

๐Ÿ’ก

Before downloading the firmware, check its hash amount (MD5) using the MD5 Checker utility. This will protect against downloading corrupted files.

4. Android reinstallation methods

There are three main ways to use Xiaomi:

  1. via Fastboot (recommended for official firmware).
  2. Through Recovery (suitable for custom firmware and updates).
  3. EDL (Emergency mode if the phone is not turned on).

Letโ€™s look at the first two methods in detail.

Installation via Fastboot (for official firmware)

This method is suitable for stock firmware installation (original MIUI) and requires an unlocked bootloader.

  • ๐Ÿ–ฅ๏ธ Computer with installed Xiaomi drivers (you can download through the Mi Flash Tool).
  • ๐Ÿ“ Firmware in.tgz or.zip format (unpacked in a folder).
  • ๐Ÿ› ๏ธ Mi Flash Tool (download from the official website).

Step-by-step:

  1. Turn off the phone and press Volume Down + Power to log into the Fastboot.
  2. Connect the phone to the PC.
  3. Launch the Mi Flash Tool, press Select and specify the path to the firmware folder.
  4. At the bottom, select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  5. Press Flash and wait until it is completed (5-10 minutes).

โš ๏ธ Attention: If there is an error in the process anti_rollback, This means you are trying to install an older version. MIUI, This requires firmware with the same or newer Anti-Rollback number (check on Xiaomi website).

Installation via Recovery (for custom firmware)

This method is used to install custom ROM (like LineageOS) or updates via TWRP.

  1. Download TWRP for your model from the official website.
  2. Rename the file to recovery.img and place it in the folder with ADB.
  3. In the command line, run: fastboot flash recovery.img fastboot boot recovery.img

Next:

  1. Boot to TWRP (click Volume Up + Power).
  2. Make a backup of the current firmware (optional).
  3. Press the Wipe. โ†’ Advanced Wipe and mark: ๐Ÿ—ƒ๏ธ Dalvik / ART Cache ๐Ÿ“ฑ System ๐Ÿ“„ Data ๐Ÿ”„ Cache

Install โ†’ Choose. ZIP-file

๐Ÿ’ก

After installing custom firmware, the first run can take up to 15 minutes. Do not interrupt the process, even if the screen does not react for a long time.

5. Common mistakes and their solutions

Even with the exact following of the instructions, there can be problems.

Mistake.Reason.Decision
This device is locked (in Fastboot)The bootloader is not unlockedRepeat the unlocking procedure with the Mi Unlock Tool
The phone is not defined in the Mi Flash Tool.There is no driver or faulty cableInstall drivers manually through Device Manager or try another USB cable/port
Mistake 7 in TWRPIncompatible firmware or damaged ZIP-fileCheck the firmware model and download the file again
No network after firmwareLost IMEIRestore the IMEI through Engineer Mode (instruction below)

If the connection to the mobile network is lost after the firmware, the IMEI is most likely reset.

  1. Install the Mobile Uncle Tools app from the Play Market.
  2. Open Engineer Mode โ†’ Engineer Mode (MTK).
  3. Go to Connectivity โ†’ CDS Information โ†’ Radio Information.
  4. Enter the commands (replace XXXXX on your IMEI): AT +EGMR=1.7,"XXXXXXXXXXXXXX" AT +EGMR=1.10,"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5. Reboot the phone.

๐Ÿ’ก

If the phone starts to warm up after firmware, check the load on the processor in the CPU Monitor application. Often the cause is background data synchronization or an unoptimized core in custom firmware.

7. How to return the phone to factory settings without firmware

If the goal is simply to clean the phone, rather than change the firmware, use Hard Reset, a method that does not require unlocking the bootloader and keeps the official firmware.

  1. Turn off the phone.
  2. Press Volume Up + Power before the Mi logo appears.
  3. From the Recovery menu, select Wipe Data โ†’ Wipe All Data.
  4. Confirm the action and wait for the reboot.

Differences between Hard Reset and Reflashing:

  • โœ… Save the current version MIUI.
  • โœ… Doesn't require a computer.
  • โŒ Does not eliminate system errors if they are related to damage to firmware files.

FAQ: Frequent questions about reinstalling Android on Xiaomi

โ“ Can you reflash Xiaomi without unlocking the bootloader?
No, official and custom firmware is installed only on the unlocked bootloader, except for updates via OTA (they pass without unlocking).
โ“ Will I lose my warranty after I have re-flashed?
Yes, installing custom firmware or unlocking the bootloader voids the warranty. Official firmware through the Mi Flash Tool retains the warranty, but only if you did not block the bootloader after installation.
โ“ How to find out the version of the loader (Anti-Rollback) of your model?
Type ##4636## in the phone app, then go to Phone Information. Search for Baseband version, the latest digits (e.g. V13.0.9.0.SKUCNXM) will point to the Anti-Rollback version.
โ“ What to do if the phone does not turn on after the firmware?
Try the following steps: Press Power + Volume up for 20 to 30 seconds (forced reboot). Connect to charge for 1 hour - the battery may be completely dead. Repeat the firmware through Fastboot with a choice of Clean all and lock option. If nothing helps, contact the service center - possibly damaged memory (eMMC).
โ“ Can I use Xiaomi to help you? OTG-computer-free?
Yes, but only if you have custom recovery installed (TWRP). So, for this, download the firmware to the flash drive. Connect the flash drive through. OTG-Adapter, load in. TWRP and select Install โ†’ Select Storage โ†’ USB OTG. For official firmware, a computer is required.