How to flash Xiaomi phone: official and custom firmware

While Xiaomiโ€™s smartphone firmware is a challenge that scares many users from the risk of turning the device into a brick. However, with the right approach, the process of updating or completely flashing becomes safe and opens up new possibilities, from bug fixing to installing custom builds with advanced functionality. In this article, we will analyze all the current ways Xiaomi firmware in 2026, from official updates via MIUI Updater to manual installation through Fastboot and TWRP Recovery.

It is important to understand that the procedure is different for different Xiaomi/Redmi/POCO models and firmware types. For example, for Xiaomi 13 Pro and Redmi Note 12, the bootloader unlock algorithm will be identical, but the firmware versions and drivers may differ. We will look at the universal steps that will suit most devices on Qualcomm Snapdragon and MediaTek, and also point out the key differences for specific lines.

Before you start, answer three questions: 1. What purpose do you pursue (updating, removing the bloat, installing custom firmware)? 2. Are you ready for the possible loss of warranty when unlocking the bootloader? 3. Do you have a backup copy of the data?

If the answer to at least one question is negative, first study the theory and prepare for the procedure.

1. Firmware preparation: Backup and unlock the bootloader

The first and most critical step is data backup, and the firmware erases user files in the /data partition, so without a backup, you lose:

  • ๐Ÿ“ฑ Contacts (unless synced with Google or Mi Account)
  • ๐Ÿ“ธ Photos and videos (including hidden folders) DCIM/.thumbnails)
  • ๐Ÿ”‘ Passwords from Wi-Fi and applications (stored in the /data/misc/wifi)
  • ๐ŸŽฎ Preservation of games (e.g. in the /Android/obb)

For backup, use:

  • ๐Ÿ”„ Mi Cloud (for contacts, notes, SMS)
  • ๐Ÿ–ฅ๏ธ Google Drive or Local Storage for Files
  • ๐Ÿ› ๏ธ Titanium Backup (requires root) for applications and their data

The next step is to unlock the bootloader. Without that, you can't install custom firmware or modified Recovery. Xiaomi officially lets you unlock the bootloader, but the process requires:

  1. Linking your Mi Account to your device (require to confirm your email and phone!).
  2. Expectations 7โ€“14 days after application (for new accounts)
  3. Use the official Mi Unlock Tool tool.

โš ๏ธ Warning: Unlocking the bootloader resets the device to factory settings. If you've already unlocked it before, no re-procedure is required.

๐Ÿ“Š What kind of firmware do you plan to install?
Official MIUI
LineageOS (Pixel Experience)
Stock without bloat
Another.

2. firmware selection: official MIUI vs custom builds

Before you start, you should decide on the type of software. Each option has pros and cons:

Type of firmwareAdvantagesDeficienciesWho's right for?
Official MIUI (Stable/Global)Maximum compatibility, OTA-Updates, support for all camera and sensor functionsBloat (pre-installed applications), advertising in system menus, limited customizationUsers who are interested in stability and security
MIUI without bloat (e.g. MIUI EU)Chinese services removed, no ads, weekly updatesNo official support, localization bugs are possibleThose who want a clean MIUI with the preservation of the corporate design
Castom firmware (LineageOS, Pixel Experience, crDroid)Minimalist interface, current versions of Android, lack of bloatThe camera may not work, NFC or gestures, no. OTA-updateEnthusiasts ready for manual tuning

For official firmware use resources:

  • ๐ŸŒ Official website MIUI (Choose a version for your model!).
  • ๐Ÿ”— Xiaomi Firmware Updater (archive of all versions).

For custom firmware:

  • ๐Ÿค– XDA Developers (Search for the theme of your model).
  • ๐Ÿ“ฑ Telegram channels (e.g, MIUI Russia).

โš ๏ธ Note: Unofficial firmware may contain malicious code. Always check hash files (SHA-256) reviews from other users.

Make sure the firmware you choose is compatible with your exact device model and region version (e.g. Redmi Note 11 Pro 5G and Redmi Note 11 Pro+ 5G are different devices!).

3. Xiaomi firmware methods: which one to choose?

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

  1. Through MIUI Updater (OTA) The easiest way to update official information is if: ๐Ÿ“ฒ You already have a stable/global version installed. MIUI. ๐Ÿ”„ You need to upgrade to the new version without losing data.

Restriction: you can not switch from Chinese firmware to global or vice versa.

Through Recovery (TWRP or Stock)

Allows you to install custom firmware or official ZIP-requires an unlocked bootloader and TWRP (custom-made).

Fastboot (Mi Flash Tool)

Complete flashing of the device from the PC.

  • ๐Ÿ”ง Recovery after soft brick.
  • ๐Ÿ“ฆ Official firmware installations from scratch".
  • ๐Ÿ”„ Changes in the region (e.g. with CN Globally).

The choice of method depends on your goal:

  • ๐Ÿ”„ Update without reset โ†’ OTA.
  • ๐Ÿ› ๏ธ Installation of custom firmware โ†’ TWRP Recovery.
  • ๐Ÿ”ง Recovery after failure โ†’ Fastboot.

๐Ÿ’ก

To change the firmware region (for example, from Chinese to global), be sure to use the Fastboot method. The rest of the methods will not change the region of the device.

4. Firmware through Fastboot: step-by-step instructions

This method is suitable for full flashing of the device and requires a PC with installed Xiaomi drivers.

Download Mi Flash Tool from the official website |Install Qualcomm or MediaTek | Unpack firmware into a folder without Cyrillic |Disable antivirus (can block files) | Charge your phone at least 50%-->

Step 1: Installation of drivers

For Qualcomm devices, download the drivers from here. For MediaTek, use the MTK USB Driver. After installation, check the connection:

  1. Turn off the phone.
  2. Press Volume Down + Power to Enter Fastboot.
  3. Connect to the PC and execute in the command line: fastboot devices If the device is displayed - the drivers are installed correctly.

Step 2: Preparation of firmware

Download the Fastboot firmware for your model (file with the extension.tgz or.zip). Unpack the archive in a folder. C:\miui\ (There should be files inside:

  • flash_all.bat โ€” Script for full firmware (erases data!).
  • flash_all_except_storage.bat โ€” Firmware without deleting user files.
  • images\ โ€” partition (boot.img, system.img etc.).

Step 3: Firmware via Mi Flash Tool

  1. Run the Mi Flash Tool on behalf of the administrator.
  2. Click Select and point the way to the firmware folder.
  3. Select firmware mode: clean all โ€“ complete cleaning (recommended when changing the region). clean all and lock โ€“ cleaning + lock bootloader (for sale of the device). save user data โ€“ data storage (not always stable!).

Flash

โš ๏ธ If the process is 99% frozen or an anti-rollback error appears, you are trying to install an older version. MIUI, It's a little bit more than the one before. EDL-Mode (requires an authorized Xiaomi account).

๐Ÿ’ก

If the phone doesnโ€™t turn on after firmware, try pinching Volume Up + Power for 10-15 seconds for a forced reboot.

5. Firmware through TWRP Recovery: installing custom firmware

TWRP (Team Win Recovery Project) is a custom recovery that allows you to install informal firmware, make backups and modify system partitions.

  1. Unlock the bootloader (see Section 1).
  2. Download TWRP for your model from the official website.
  3. Install it via Fastboot: fastboot flash recovery twrp-3.7.0-alioth.img fastboot boot twrp-3.7.0-alioth.img

Installation of custom firmware:

  1. Download firmware (like LineageOS or Pixel Experience) and GApps (if you need Google services).
  2. Reboot to TWRP (click Volume Up + Power).
  3. Backup โ†’ Select Partitions โ†’ Swipe to Backup.
  4. Run Wipe โ†’ Advanced Wipe and mark: Dalvik / ART Cache System Data Cache

GApps

Install โ†’ Select ZIP

Reboot โ†’ System

The first run after installing custom firmware can take 10-15 minutes.

What if TWRP doesnโ€™t see internal memory?
If TWRP It doesn't display files in the internal memory, it's probably encrypted. Solution: 1. Copy the firmware to the SD-and set it up from there. 2. TWRP Enter your device password (if installed). 3. Format the Data partition (will result in loss of all data!).

6. Solving problems after firmware

Even with the right instructions, you can get errors, and let's look at the typical problems and their solutions.

Problem.Possible causeDecision
Phone not turned on (black screen)Incorrect firmware or interrupted processRepeat the firmware through Fastboot with a full clean (clean all)
Hanging on the MI logoModule conflict or incompatible firmwareInstall the official firmware through the Mi Flash Tool
No network (IMEI lost)The modem or EFS partition is damagedRestore the EFS backup or stream modem separately
Camera or sensors are not working.There are no drivers in the custom firmwareInstall a patch for the camera (such as the ANX Camera)

If IMEI is missing after the firmware:

  1. Check it out via the command: adb shell su -c 'service call iphonesubinfo 3' If returns null - IMEI erased.
  2. Restore /data/radio/ or /efs/ from the backup folder.
  3. If you donโ€™t have a backup, use tools like Maui META (MediaTek only!) or contact a service center.

For devices on Qualcomm recovery IMEI perhaps QCN-file, but requires special equipment (QPST).

7.How to return the official firmware after custom

If youโ€™ve experimented with custom firmware and want to return stock MIUI, follow this algorithm:

  1. Download the official Fastboot firmware for your model from the Xiaomi website.
  2. Unlock the bootloader (if it was blocked after installing custom firmware).
  3. Sweat through the Mi Flash Tool in clean all mode (see section 4).
  4. Block the bootloader (optional, for guarantee): fastboot oem lock โš ๏ธ After this command, the device will return to factory condition, and unlocking will require a second wait (7-14 days).

Avoid firmware marked Alpha or Test - they may contain critical bugs.

โ“ What to do if the touchscreen does not work after the firmware?
This is a typical problem when installing firmware that is incompatible with your model. Solutions: Make sure the firmware is designed for your device (check the model code in Settings โ†’ About Phone). Refuse the official version through the Mi Flash Tool. If the problem persists, the touchscreen plume may have been damaged (requires repair).
โ“ How to upgrade to Xiaomi if OTA-updates don't come?
If your device doesn't get updates by air: Check if the region restrictions are worth it (e.g. Chinese firmware often doesn't get global OTAs). Download the full service pack (.zip) from Xiaomi Firmware Updater and install via MIUI Updater (click three dots โ†’ Select an update file). If the update doesn't install, run it through TWRP or Fastboot.