How to independently reflash Xiaomi smartphone through your computer: from unlock to install MIUI

Flashing Xiaomi’s smartphone through a computer is a daunting task, but with the right instructions and preparation, it becomes easy for beginners to understand. Unlike air-to-air updates, hand-to-hand firmware via PCs gives you complete control over the software version, allows you to install custom builds or bring the device back to life after software failures.

The main advantage of firmware through the computer is the ability to choose any version of MIUI (including global, Chinese or European builds), as well as install alternative firmware like LineageOS or Pixel Experience. However, the process requires care: an error in the stage of unlocking the bootloader or selecting the wrong firmware can turn a smartphone into a β€œbrick.” In this article, we will analyze all the steps from preparation to final configuration, taking into account the nuances for different Xiaomi, Redmi and POCO models.

⚠️ Critical Warning: The firmware over the PC resets all data on the device.If you haven't backed up through Mi Cloud or locally, photos, contacts and messages will be lost without recovery. Also note that unlocking the bootloader will void the warranty on most Xiaomi devices (except models for the European market, where it is officially allowed).

1. Firmware Preparation: What to Do Before Starting

The first step is to check the compatibility of your model with the selected firmware. Xiaomi devices are divided into two categories by type of bootloader:

  • πŸ”“ With the unlocked bootloader - you can install any firmware (official and custom).
  • πŸ”’ With a locked bootloader – official unlocking via Mi Unlock Tool is required.

Find out the status of the bootloader is simple: turn off the smartphone, press Volume down + Power to enter Fastboot mode. If you see the message Locked at the bottom of the screen - bootloader is locked. Also check the device model in the settings (Settings β†’ About phone β†’ Model), since the firmware is strictly tied to the model code (for example, the Redmi Note 11 Pro 5G has the code veux, and the POCO X3 Pro - vayu).

List of necessary tools:

  • πŸ’» Computer on Windows 10/11 (Mi Unlock Tool is required for Windows).
  • πŸ”Œ Original. USB-cable (cheap cables can cause errors in data transmission).
  • πŸ“± Charged smartphone (minimum 60% battery).
  • πŸ”§ Programs: Mi Flash Tool, ADB & Fastboot, Xiaomi drivers.
πŸ“Š What kind of firmware do you plan to install?
Official MIUI (Stable)
Official MIUI (beta)
LineageOS (Pixel Experience)
I don't know, I'm exploring options.

2 Unlock the bootloader: the official way through Mi Unlock

Officially unlocking the bootloader is a must for most Xiaomi devices, requiring the Mi Account to be linked to the phone and waiting for permission from the company’s servers.

  1. Link your Mi Account to your device: Go to Settings β†’ Mi Account. Sign in (if not, sign up) Activate Find Device and Sync.
  2. Connect your device to your PC in Fastboot mode: Turn off your smartphone. Press Volume Down + Power before the Fastboot logo appears. Connect the USB cable to your computer.

Launch the Mi Unlock Tool:

  • Download the latest version of the utility from the official website.
  • Install and run the program on behalf of the administrator.
  • Log in to the same Mi Account as on your phone.

Once you have successfully authorized it, it will show the status of the device. If the bootloader is locked, press Unlock. The process can take anywhere from a few minutes to 72 hours β€” that's fine, because Xiaomi servers check the unlock request. Don't turn the device off while you wait!

What to do if Mi Unlock Tool gives you a "Couldn't unlock" error

The Couldn't unlock error (or codes 86006, 86012) means that Xiaomi servers have rejected the request.

  • Mi Account is not tied to the device (check sync in settings).
  • The device does not support unlocking (relevant for some Chinese models).
  • Servers are overloaded (try later or use a VPN with the region of China).

Solution: Repeat account binding, wait 72 hours or try alternative unlocking methods (e.g., through a user account). EDL-The regime, but it is risky for beginners).

⚠️ Important: Once the bootloader is unlocked, the smartphone will perform a hard reset, all data, including photos in the internal memory, will be deleted. If you do not back up, it will not be possible to return them.

3. firmware selection: official MIUI vs custom builds

The type of firmware depends on the functionality, stability and even battery life of the device.

Type of firmwareAdvantagesDeficienciesSuitable for
Official MIUI (Stable)Maximum stability, OTG support, all camera features work.Advertising in system applications, limited customization.Users who need reliability and full compatibility.
Official MIUI (beta)New features before everyone else, less advertising.Possible bugs, quick discharge of the battery.Enthusiasts who are ready to test new software.
LineageOS (Pixel Experience)Clean Android without ads, long-term support for outdated models.NFC, wide camera angle, or gestures may not work.Advanced users who care about privacy.
Port from other devices (e.g. MIUI from POCO to Redmi)Unique features from other models.High risk of "bricking", unstable work.Experienced users who are ready for experimentation.

For beginners, we recommend starting with the official stable MIUI.

  • 🌍 Official global portal - firmware for international versions.
  • πŸ‡¨πŸ‡³ Chinese portal – current builds for Chinese models (requires language or translator).
  • πŸ“¦ Xiaomi Firmware Updater – firmware archive with easy search by model.

When choosing a firmware, pay attention to:

  • πŸ“Œ Model code (e.g., raphael for Redmi) K20 Pro).
  • πŸ“… Android version (some custom firmware requires a specific base).

πŸ’‘

If you are downloading firmware from a third-party site, be sure to check the hash file (MD5) after download.This will protect against forgery. The hash can be checked using the MD5 & SHA Checksum Utility utility or online services.

4. Installation of drivers and preparation of PC

Without properly installed drivers, the computer will not recognize the smartphone in Fastboot or EDL modes. Xiaomi devices require:

  • πŸ“± Xiaomi drivers – for the correct definition of the device.

The easiest way to install everything you need is to use the Mi Flash Pro package (which includes drivers and utilities), download it from the official website and follow the installer's instructions.

  1. Connect your smartphone in Fastboot mode (as described earlier).
  2. Open Device Manager on PC (Win + X β†’ Device Manager).
  3. Make sure that the Android Bootloader Interface or Xiaomi... (Fastboot) device appears in the list.

If the device is defined as Unknown:

  1. Click on it with the right button β†’ Update the driver.
  2. Select Search for drivers on this computer.
  3. Specify the path to the driver folder (usually C:\MiFlash\Driver).

β˜‘οΈ Pre-firmware check

0

Make sure that all the points are met:

1.Mi Account is linked to the device and unlock is confirmed.

2. firmware downloaded and tested for integrity (MD5).

3. Drivers are installed, the smartphone is determined in Fastboot.

4. backup copy of the data is created (if necessary).

5. The battery is at least 60 percent charged.

5. Firmware through Mi Flash Tool: step-by-step instructions

Mi Flash Tool is the official tool from Xiaomi for firmware devices in Fastboot mode. It supports all models of the brand and allows you to choose the type of installation: save data (Save user data) or complete cleanup (Clean all). For stable operation, we recommend a complete cleanup to avoid conflicts with the previous version of the software.

Firmware instructions:

  1. Unpack the firmware: The downloaded file is usually.tgz or.zip. Unpack it in a short-cut folder (e.g., C:\MIUI\) to avoid errors.
  2. Launch Mi Flash Tool: Open the program on behalf of the administrator. Press Select and specify the folder with the unpacked firmware.
  3. Connect your smartphone: Put the device in Fastboot mode (Loudness down) + Power. Connect. USB-The program must have a device, for example, COM3 - Qualcomm HS-USB QDLoader 9008).
  4. Select firmware type: Clean all – complete cleaning (recommended); Save user data – saving user data (error risk); Clean all and lock – cleaning + locking the bootloader (only for official firmware).

Start the firmware:

  • Press Flash and wait until it is completed (usually 5-10 minutes).
  • The appearance of a green checkmark and the inscription Success means a successful installation.

If the process is suspended in the Waiting for device stage:

  • Check your USB connection (try another port or cable).
  • Reinstall drivers manually through Device Manager.
  • Try running the Mi Flash Tool in Windows 7 compatibility mode.

πŸ’‘

If your smartphone doesn't turn on or hangs on the MI logo after you've done it, try re-switching the clean all device, which solves the problem 90 percent of the time.

6. firmware custom software (TWRP + Custom ROM)

Installing custom firmware like LineageOS or Pixel Experience requires pre-installing a custom TWRP recavator, a process that is more complex and suitable for advanced users.

  1. Install TWRP: Download the TWRP version for your model from twrp.me. Rename the file to twrp.img and place it in the folder with ADB. Open the command prompt in this folder (Shift + right button β†’ Open the PowerShell boot window here). Enter the commands: adb reboot loader fastboot flash recovery twrp.imgboot reboot recovery
  2. Backup to TWRP: In the TWRP menu, select Backup. Tag the Boot, System, Data sections. Swipe to create a backup (save it to your PC).

Install custom firmware:

  • Download the firmware (like LineageOS) and place it on your smartphone.
  • In TWRP, click Install, select a firmware file and swipe to install.
  • After installation, run Wipe β†’ Format Data (required!).

⚠️ Warning: Some custom firmware does not support encryption, and if the device requires a password after installation but does not accept it, you will have to repeat the process of formatting the Data partition.

Popular custom firmware for Xiaomi:

  • πŸ“± LineageOS – pure Android with long-term support.
  • 🎨 Pixel Experience – The interface is like Google Pixel.
  • ⚑ ArrowOS – Balance between productivity and customization.
  • πŸ”§ Havoc-OS – maximum configuration of the appearance.

7. Solving problems after firmware

Even with the correct following of the instructions, errors can occur.

Problem.Possible causeDecision
The smartphone is not turned on (black screen)Incorrect firmware or interrupted processRepeat the firmware with full cleaning (Clean all)
Hanging on the MI logoConflict with the previous version of MIUIRe-scan with Data Formatting
The Anti-rollback errorTrying to install an old version of MIUIFind firmware with the same or newer Anti-rollback index
The sensor or camera is not working.Incompatible custom firmwareInstall an official MIUI or find firmware that supports your model
No network (IMEI lost)The modem or EFS partition is damagedRestore the EFS backup or flash the official firmware

If IMEI is missing after the firmware:

  1. Make sure you have a backup of the /efs folder (if you did backup in TWRP).
  2. If you don’t have a backup, try restoring your IMEI with the engineering menu: ##4636## β†’ Phone Information β†’ Select SIM β†’ Enter IMEI
  3. In extreme cases, run the official firmware through the Mi Flash Tool with the Clean all and lock option.

⚠️ Note: If after firmware, the smartphone is no longer defined by the computer in Fastboot mode, but turns on in normal mode, most likely, the recovery section is damaged. Solution: run the official firmware through the EDL-Mode (requires an authorized Xiaomi account or paid service).

8. Post-firmware optimization

After successful firmware, we recommend following several steps to improve performance and stability:

  • ⚑ Disable unnecessary system applications: Use ADB To deactivate Bloatware: adb shell pm uninstall -k --user 0 com.miui.analytics A list of safe packet removal options can be found on the forums XDA Developers.
  • πŸ”‹ Battery calibration: After firmware completely discharge the smartphone before switching off. Charge before 100% No interruptions. Repeat the cycle. 2-3 time to accurately display the charge level.
  • πŸ“‘ Network settings: Go to Settings β†’ SIM-maps and mobile networks: select the preferred type of network (e.g, 4G/3G/2G instead of 4G better coverage).

For custom firmware, it is also useful:

  • Install Magisk to obtain root rights (if necessary).
  • Set up Kernel Adiutor for fine kernel optimization.
  • Use Greenify to hibernate background applications.

πŸ’‘

After you have installed custom software, be sure to check the basic functions: calls, mobile Internet, Wi-Fi, Bluetooth and camera. If something doesn’t work, look for the firmware with fixes for your model on the XDA or 4PDA forums.

FAQ: Answers to Frequent Questions

Can I use Xiaomi without unlocking the bootloader?
No, installing any firmware through a PC (except updates via Recovery) requires an unlocked bootloader. EDL-mode, but this requires an authorized Xiaomi account or special equipment.
How to return the official firmware after custom?
Download the official firmware for your model from Xiaomi and run it through the Mi Flash Tool with the Clean all and lock option. This will also block the bootloader back (but only for official firmware).
Why does the Mi Flash Tool give you the error "Flash is not done"?
This error is caused by: Incorrect firmware version (not suitable for your model) damaged firmware file (check out) MD5-No drivers (reinstall them manually) Solution: Repeat the process with another firmware or on another PC.
Can I use Xiaomi on Mac or Linux?
Officially, the Mi Flash Tool only works on Windows. However, you can use the Mac/Linux terminal for firmware via Fastboot with commands: fastboot flash boot.img fastboot flash system.img fastboot reboot For custom firmware, TWRP + ADB (cross-platform tools) is suitable.
How do I know which firmware is installed on my Xiaomi?
Go to Settings β†’ About β†’ MIUI. It will indicate: MIUI version (e.g. MIUI Global 14.0.5). Android version (e.g. Android 13). Model code (e.g. Redmi Note 10 Pro - sweet). For details, use the Device Info app from Google Play.