How to install firmware on a locked Xiaomi through a computer: the full guide 2026

A locked Xiaomi smartphone is not a sentence. Even if you forget your password, your pattern lock or device is in a bootloop state, it's quite possible to flash it through your computer. However, the process requires care: wrong actions can turn your phone into a brick. In this article, we will examine all the working methods, from the official Mi Flash Tool to alternative methods using ADB and Fastboot.

The main problem with locked Xiaomi devices is active protection Mi Account, which blocks unauthorized changes to the firmware. You can bypass it, but it requires unlocking the bootloader. We will describe in detail how to do this legally (through an official request) and what workarounds exist for older models. You will also learn what tools you need, how to avoid errors like Invalid Image or Anti-Rollback, and what to do if the phone is not determined by the computer.

Important: PC firmware is suitable for most Xiaomi, Redmi and POCO models released after 2016. Older devices (such as the Mi 3 or Redmi Note 2) may require other tools, as we’ll talk about.

πŸ“Š Your Xiaomi phone is blocked because of the...
Forgotten password
pattern lock
Hardware failure (bootloop)
Hand-held purchases (linked to someone else's Mi Account)
The other.

1. Preparation for firmware: what will be needed

Before you start firmware, make sure you have everything you need. Without proper preparation, the process can end up with an error or permanent locking of the device.

The main tools and files:

  • πŸ–₯️ Computer on Windows 7/10/11 (The Mi Flash Tool requires Windows; macOS/Linux We will have to use alternative methods).
  • πŸ“± Cable USB Type-C or Micro-USB (original or quality certified – cheap cables often cause connection errors).
  • πŸ”§ Xiaomi drivers for your model (you can download on the official website or through Mi). PC Suite).
  • πŸ“ Firmware in.tgz or.zip format (must match the phone model and bootloader version).
  • πŸ”“ Mi Account tied to your phone (if you plan to unlock the bootloader officially).

Where to get firmware? The official versions can be downloaded from Xiaomi Firmware. Alternative builds (e.g. xiaomi.eu or PixelExperience) can be found on the 4PDA or XDA Developers forums. Pay attention to the Android version and region (Global/China/EEA) - a mismatch can lead to network or camera problems.

What is dangerous firmware from third-party developers?
Unofficial firmware may contain malicious code, unstable kernels, or remote features (such as NFC or encryption), and they often violate the Anti-Rollback policy, which leads to the device being locked after an update.

Before you start working, disable the antivirus – it can block firmware files or tools like the Mi Flash Tool. Also check that there is enough free space on the computer (firmware weighs 1.5-3 GB, and unpacked takes up to 5 GB).

2 Unlocking the bootloader (bootloader) - a mandatory step

Without an unlocked bootloader, it is impossible to flash Xiaomi through a PC. Xiaomi has introduced this protection to prevent unauthorized system changes. Unlocking takes 3 to 7 days (the official way) or can be done instantly (unofficial methods, but with risks).

The official method (recommended for most users):

  1. Link your phone to your Mi Account (if it is not already blocked).
  2. Go to Mi Unlock and request permission to unlock.
  3. Download the Mi Unlock Tool and connect your phone in Fastboot mode (clip Volume Down + Power).
  4. Follow the instructions of the program. Usually, the unlock occurs in 72-168 hours.

If the phone is completely locked (it doesn’t turn on or respond to buttons), official unlocking is impossible – a workaround method is required. For older models (Redmi 4X, Mi 5, etc.), there are utilities like DeepFlash or EDL Mode, but they require command line knowledge and can lead to loss of IMEI.

πŸ’‘

If you have a phone with a Qualcomm processor (most Xiaomi models), you can use the QFil utility to unlock in EDL mode. However, this method is risky - if you make a mistake, the device can turn into a "brick".

3. Install firmware via Mi Flash Tool

Mi Flash Tool is Xiaomi’s official Fastboot firmware utility, which supports most models and allows you to choose between Save User Data or Clear All.

Step-by-step:

  1. Download and install the Mi Flash Tool (the latest version can be found on the official website).
  2. Unpack the firmware in a folder without Cyrillic characters (for example, C:\Xiaomi\firmware).
  3. Run the Mi Flash Tool on behalf of the administrator.
  4. Connect your phone in Fastboot mode (click Volume Down + Power until a bunny with the word Fastboot appears).
  5. In the program, click Select and specify the path to the folder with the firmware.
  6. Select Clean All mode and press Flash.

It takes 5-15 minutes. When it's finished, the phone automatically restarts. If you have an Anti-Rollback error, you're trying to install an older version of the firmware than the one on the device, and you need to download a new firmware or use EDL Mode.

β˜‘οΈ Pre-firmware check

Done: 0 / 5

4. Alternative firmware methods

If the Mi Flash Tool doesn’t work (for example, due to an Invalid Image error or lack of model support), you can use other tools:

  • πŸ”§ Fastboot via command line: suitable for power users.Commands for firmware: fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash system system.img The complete list of commands depends on the firmware structure.
  • πŸ“± EDL Mode (Emergency Download Mode): Used for bricked devices, requires special cable or short circuits on the board (for Qualcomm).
  • πŸ–₯️ SP Flash Tool: Relevant for Mediatek-based devices (e.g. Redmi) 9A or POCO C3).

Firmware through EDL is an extreme method. It requires an auth file (for new models) or a modified cable. Without it, the phone is not recognized by QFil. Forums often sell "authorization files" - beware, it can be a scam.

For devices on Mediatek, the procedure for the SP Flash Tool is as follows:

  1. Download the firmware in.zip format and unpack it.
  2. Run the SP Flash Tool and download the scatter.txt file from the firmware folder.
  3. Connect the phone to the PC (drivers must be installed).
  4. Press Download and wait for the process to end.

πŸ’‘

Firmware via EDL or SP Flash Tool resets all data, including IMEI. After the procedure, you may need to restore network settings.

5. Common mistakes and their solutions

Even with the correct following of the instructions, errors can occur, and here are the most common ones and ways to fix them:

Mistake.Reason.Decision
Invalid ImageModel firmware mismatch or damaged fileDownload the firmware again, check the phone model
Anti-RollbackTrying to install an old version of the firmwareUse a new firmware or update via EDL
Device not foundNo drivers or cable issuesInstall drivers, try another USB cable/port
Mi Account lockedThe phone is linked to another accountUnblock your account officially or through workarounds
Flash not doneLack of rights or locking of the bootloaderUnlock bootloader, start the program from the admin

If the phone does not turn on after firmware or hung on the Mi logo, try:

  • πŸ”„ Repeat the firmware with full cleaning (Clean All).
  • πŸ“₯ Install a different firmware version (e.g., try China instead of Global).
  • πŸ”§ Restore IMEI via the engineering menu (code ##4636## or #36446337##).
What if there is no network after the firmware?
This is usually due to a loss of IMEI or a mismatch in the firmware region. Use utilities like SN Write Tool (for Qualcomm) or Maui Meta (for Mediatek) to restore IMEI. Alternatively, you can manually enter IMEI through an engineering menu.

6. Data recovery after firmware

Firmware via Fastboot or EDL completely erases data from the device, but in some cases it can be restored:

  • πŸ“ Backups: If you have previously created a backup through Mi Cloud or Google Account, data can be returned after you log in to your account.
  • πŸ’Ύ Recovery from memory card: If files were stored on an SD card, they will remain intact.
  • πŸ” Recovery programs: DiskDigger, Recuva or 7-Data Recovery can find deleted files, but the chances are low.

For the future: To avoid data loss, regularly sync contacts, photos and messages with Mi Cloud or Google Drive, and you can also use backup apps like Swift Backup (requires root rights).

πŸ’‘

If the phone is locked but turns on, try connecting it to your PC in MTP mode and copy important files before the firmware, which may require unlocking the screen via ADB (if USB debugging is enabled).

7. Firmware without unlocking the bootloader: myth or reality?

Many users are looking for ways to flash Xiaomi without unlocking the bootloader. Theoretically, this is only possible for older models (before 2016) or through exploits that are quickly closed with updates. For example, there was a method using Test Point (closing contacts on the board), but for modern devices it does not work.

The only legal ways to do this are:

  • βœ… Unlocking with Mi Unlock Tool.
  • βœ… Firmware through EDL with an authorization file (for service centers).
  • ❌ Bypass methods (like DeepFlash) – risky and can lead to blocking IMEI.

If you bought a phone with your hands and it is locked on someone else's Mi Account, you can officially unlock it only with a check or the consent of the previous owner, otherwise only the firmware through EDL remains, with the risk of loss of functionality.

πŸ’‘

When buying Xiaomi with your hands, always check the status of Mi Account through the Settings menu β†’ My device β†’ All specs. If there is a binding, ask the seller to untie the account before buying.

FAQ: Frequent questions about the firmware of the blocked Xiaomi

Can I use Xiaomi without a computer?
Yes, but only if the phone turns on and you have access to Recovery, you need to download the firmware on the memory card, go to Recovery (press Volume Up + Power) and select Install update.zip. However, this method will not work if the bootloader is blocked or the system is damaged.
What if the Mi Flash Tool can't see the phone?
Check this: Are Xiaomi drivers installed (you can download from Mi PC Suite); Are you using the original cable (cheap cables often don't transmit data to Fastboot); Is the phone connected to a USB 2.0 port (USB 3.0 ports sometimes cause problems); Is the program running on behalf of the administrator; If nothing helps, try another computer or install drivers manually through Device Manager.
How to find out the phone model if it does not turn on?
You can identify the model by: Inscriptions on the box or under the battery (if removable). IMEI (look at the sticker under the battery or on the box, then check on IMEI.info). Fastboot mode: connect the phone to the PC and type in the command fastboot getvar product.
Why does the phone ask for a password from Mi Account?
This means that the firmware has not reset the account. Solutions: Enter the previous owner's details (if the phone is bought with your hands, ask him for a login/password). Sweep the phone again with a full clean (Clean All). Use the EDL Mode with an authorization file (only for experienced users). If nothing helps, contact the Xiaomi service center with a check for a purchase.
Can I use Xiaomi on Mac or Linux?
Officially, the Mi Flash Tool only works on Windows, but there are alternatives: 🍎 On Mac: Use Fastboot via Terminal or a Windows virtual machine. 🐧 On Linux: install fastboot and flash through the command line. Example: sudo fastboot flash system system.img For EDL on Mac/Linux You will need to collect QFil from source code, which is difficult for beginners.