How to install firmware on Xiaomi: safe ways and step-by-step instructions

Installing new firmware on Xiaomi devices is a way to get fresh features, improve performance, or even resurrect an old smartphone. However, the process requires caution: wrong actions can turn a gadget into a brick. In this article, we will examine all current firmware methods, from official updates through MIUI to manually install custom assemblies through Fastboot and Recovery.

It is important to understand that there are three types of firmware: stable (recommended for most users), development (with new features, but possible bugs) and custom (created by enthusiasts such as LineageOS or Pixel Experience). Each option has its own nuances, from unlocking the bootloader to the risk of losing warranty. We will analyze each step in detail so that you can choose the best path.

If you want to just upgrade to the latest version, you need to have built-in MIUI tools, but if you want to install firmware from another region (for example, switch from Chinese to global) or custom build, you need to unlock the bootloader and use a PC. Let's start with preparation.

1. Preparation of the device for firmware

Before any firmware manipulation, several critical steps must be taken, and neglecting them can lead to data loss, malfunctions, or even device failure.

One is to back up. Use the built-in Settings tool โ†’ About Phone โ†’ Backup or third-party utilities like Titanium Backup (requires root).

  • ๐Ÿ“ฑ Contacts (export to.vcf)
  • ๐Ÿ“ท Photos and videos (copy to PC or cloud)
  • ๐Ÿ”‘ Passwords from applications and Wi-Fi (write manually)
  • ๐ŸŽฎ Save games (if important, use a cloud sync)

The second is to check the device model and the current firmware, which will help you avoid installing incompatible software. Find information in Settings โ†’ Phone โ†’ MIUI version and Device Model. For example, Redmi Note 10 Pro has the code name sweet, and Poco X3 Pro is vayu.

๐Ÿ’ก

If you are planning to switch from Chinese to global firmware, check your model support on MIUI Download. Some devices (like the Redmi K40) have separate versions for China and the global market, and their firmware is not interchangeable.

Three, charge the battery at least 60 percent, and it can take 10 to 40 minutes to run the firmware, and discharging in the middle of the process can have serious consequences.

  • ๐Ÿ–ฅ๏ธ Windows computer 7/10/11 (for methods with Fastboot)
  • ๐Ÿ”Œ Original. USB-cable (a faulty cable may interrupt the process)
  • ๐Ÿ“ฅ Downloaded firmware (official or castom) in.zip or.tgz format

Check the device model|Create a backup copy|Charge the battery. >60%|Download the right firmware|Prepare. USB-cable-->

2. Official ways to update MIUI

If your goal is to simply upgrade to the latest version without risk, use Xiaomiโ€™s built-in tools.This method does not require unlocking the bootloader and is suitable for 90% of users.

Method 1: Air Update (OTA)

The easiest option is to update through the settings menu:

  1. Open Settings โ†’ About the phone โ†’ System update.
  2. Click on "Check Updates."
  3. If a new version is available, download it (wi-fi or mobile internet required).
  4. After downloading, click "Install" and wait for the reboot.

Method 2: Manual installation via Recovery

If OTA-update does not come (for example, due to regional restrictions), you can install the firmware manually:

  1. Download the full firmware package (.zip) from the official MIUI Download website.
  2. Rename the file to update.zip and place it in the root folder of internal memory.
  3. Press the Power + Volume buttons up to enter Recovery.
  4. Select โ€œInstall update.zipโ€ and confirm the installation.
๐Ÿ“Š What kind of updates do you use more often?
Automatic (OTA)
Manual through Recovery
Through Fastboot.
Custom firmware
MethodYou need a PC?Data dump?Suitable for
OTAโŒ No.โŒ No.Update within one MIUI branch
Recovery (update.zip)โŒ No.โŒ No (if the version is compatible)Manual installation of official firmware
Fastboot (miflash)โœ… Yes.โœ… Yes (full reset)Change of region, downgrade, restoration
Custom firmware (TWRP)โœ… Yes.โœ… Yes (recommended)Installation of LineageOS, Pixel Experience, etc.

When you switch from one MIUI branch to another (for example, from Stable to Developer), you may need to format the data, in which case all user files will be deleted.

3. Unlocking the Xiaomi bootloader

To install firmware through Fastboot or custom Recovery (such as TWRP), you need to unlock the bootloader. This process is officially supported by Xiaomi, but has limitations:

  • ๐Ÿ”“ Unlocking resets the device to factory settings.
  • โณ Waiting is required. 7-15 Days (depending on your Mi Account).
  • ๐Ÿšซ On some models (e.g. Redmi Note 12 for China), unlocking may be prohibited.

Step-by-step:

  1. Link the device to your Mi Account in Settings โ†’ Xiaomi Account.
  2. Activate USB debugging: Settings โ†’ About Phone โ†’ MIUI version (click 7 times to become a developer), then Settings โ†’ Additional โ†’ For Developers โ†’ Debugging over USB.
  3. Download the Mi Unlock Tool and launch it on PC.
  4. Sign in to the tool under the same Mi Account as on your phone.
  5. Connect the device in Fastboot mode (press Power + Volume down when the phone is off).
  6. Click Unlock and wait until it is completed (it may be necessary to try again in a week).
What happens if you unlock the bootloader on the operator-bound device?
On some devices (such as MegaFonโ€™s Redmi or Beeline), unlocking the bootloader can cause you to lose communication with the operatorโ€™s network, which is because carrier firmware often contains a modified radio-PO that is not compatible with standard MIUI builds.

โš ๏ธ Warning: Once the bootloader is unlocked, the device becomes more vulnerable to malware. Install firmware only from trusted sources (the official Xiaomi website or trusted forums like the one on the site). XDA Developers).

4. Install firmware via Fastboot (MiFlash)

The Fastboot method is used to completely flash the device, change the region or recover from a crash. It requires a PC and an official MiFlash utility.

What you need:

  • ๐Ÿ–ฅ๏ธ Computer with Windows and Xiaomi drivers (download here).
  • ๐Ÿ“ฆ Firmware in.tgz format (unpack it into a folder without Cyrillic characters).
  • ๐Ÿ”Œ USB-cable (preferably original).
  • ๐Ÿ”ง MiFlash (last version).

Instructions:

  1. Turn off the device and put it in Fastboot mode (clip Power + Volume down).
  2. Connect to a PC. Android Bootloader Interface should appear in the Device Manager.
  3. Launch MiFlash, press โ€œSelectโ€ and specify the folder with the unpacked firmware.
  4. At the bottom of the window, 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).

Press Flash and wait until it is completed (usually 5-10 minutes).

๐Ÿ’ก

Clean all removes ALL data, including internal memory (photos, videos, documents) and if you want to save files, pre-copy them on your PC.

If the process ends with a critical partition error, try:

  • Reconnect. USB-cable.
  • Change the USB port (better use USB 2.0).
  • Reboot the PC and repeat the process.

5. Install custom firmware (TWRP + ADB)

Custom firmware (such as LineageOS, Pixel Experience or HavocOS) allows you to get a clean Android without a MIUI shell, longer support for older devices or additional features, but their installation requires an unlocked bootloader and TWRP (custom recovery).

Preparation:

  1. Unlock the bootloader (see Section 3).
  2. Download TWRP for your model from twrp.me (pay attention to the codename of the device!).
  3. Download custom firmware (.zip format) and, if necessary, GApps (Google services).
  4. Install on your PC ADB and Fastboot (part of the Android SDK).

Installation of TWRP:

fastboot flash recovery twrp-3.7.0_9-0-sweet.img


fastboot boot twrp-3.7.0_9-0-sweet.img

After that, the device will be loaded into TWRP.

Installation of firmware:

  1. In TWRP, select โ€œWipeโ€ โ†’ โ€œAdvanced Wipeโ€ and select Dalvik, Cache, System, Data.
  2. Return to the main menu, select โ€œInstallโ€ and specify the firmware file.
  3. If you need GApps, install them immediately after you have firmware (no reboot!).
  4. Restart the device (the first start can take 10-15 minutes).

โš ๏ธ Note: Some custom firmware does not support data encryption. If the device requests a password after installation, but does not accept it, you will have to repeat the process and format Data into the data. TWRP (Wipeยป โ†’ ยซFormat Dataยป โ†’ enter).

6. Solving common errors

The firmware process doesn't always go smoothly. Let's look at the typical problems and their solutions.

Mistake.Reason.Decision
This package is for "sweet" devices; this is a "".The firmware is not suitable for your model.Check the code name of the device and download the correct version.
Couldn't unlock bootloaderIt has not been 7 days since the account was attached.Wait until the deadline is set or try another Mi Account.
The device does not turn on after the firmware.Incompatible firmware or interrupted process.Repeat the firmware through Fastboot with Clean All mode.
E: Unknown command [log] in TWRPA damaged firmware file.Download the firmware and check the checksum (MD5).

If the device is stuck on the MI (bootloop) logo, try:

  1. Press Power + Volume up for 10-15 seconds for forced reboot.
  2. If it doesnโ€™t work, run your device through Fastboot in clean all mode.
  3. For custom firmware, check the compatibility of the core and modules.

Useful commands for diagnosis:

fastboot devices # Check the connection of the device


fastboot getvar all # View device information




adb reboot recovery #Reboot in Recovery

7. How to get back the official firmware

If you have decided to return to standard MIUI after experimenting with custom firmware, do the following:

Method 1: Fastboot (recommended)

  1. Download the official firmware for your model in.tgz format.
  2. Unpack it in a folder without spaces and Cyrillic.
  3. Start MiFlash, select the firmware folder and clean all mode.
  4. Connect the device to Fastboot and press โ€œFlashโ€.

Method 2: Recovery (if the Fastboot is not working)

  1. Download the firmware in.zip format and rename it to update.zip.
  2. Put the file in the root of the internal memory.
  3. Press Power + Volume Up to Enter Recovery.
  4. Select โ€œInstall update.zipโ€ and confirm.

๐Ÿ’ก

Once you return to the official firmware, the bootloader will remain unlocked. To lock it back, select clean all and lock mode in MiFlash. Note that this will reset all data again!

FAQ: Frequent questions about Xiaomi firmware

Can I use Xiaomi without unlocking the bootloader?
Yes, but only official updates through OTA or Recovery.Unlocking is mandatory to change region, downgrade or custom firmware installation.
Will I lose my warranty after I have been slapped?
Official updates via OTA or MiFlash are not unwaived, unlock the bootloader and install custom firmware, yes, but in some service centers you can return official software before you call.
How to check if the bootloader is unlocked?
Turn off the device and press Power + Volume down. If you see a hare in a hat that says Unlocked, the bootloader is unlocked. If there's no label, it's locked.
Can I use Xiaomi to help you? OTG-cable?
Technically yes, but only if you have already installed it. TWRP. Connect. OTG-smack-in-the-box, go into the TWRP and select the file to install. Fastboot PC is mandatory.
What if the network does not work after the firmware?
This is a typical problem when changing the firmware region. Try: Manually select the operator in Settings โ†’ SIM-maps and mobile networks. Swipe the modem module from old firmware through TWRP. Install firmware with support for your region (for example, EEA Europe).