How to open Xiaomi through a computer: unlock the bootloader and install firmware

Unlocking a Xiaomi smartphone through a computer is a procedure that is required to install custom firmware, obtain root rights or restore the device after software failures. Unlike a standard reset via Recovery, working with a PC gives you complete control over the system, but also requires caution: one wrong step can turn a phone into a brick. This instruction is relevant for all Xiaomi, Redmi and POCO models starting in 2018, including Xiaomi flagships 14 and the budget Redmi Note 13.

The main difficulty lies in Xiaomi’s official policy: the company blocks the bootloader on all devices to prevent unauthorized system changes. Unlocking through the Mi Unlock Tool is the only legal way to get around this restriction, but even it has its own nuances. For example, new models require binding a Mi Account to the device and waiting 168 hours (7 days) before unlocking. In this article, we will examine all the steps from preparing a PC to installing TWRP and custom firmware.

We warn you in advance that the procedure will void the warranty and may result in data loss.If your goal is simply to reset your password or pattern lock, it is better to use standard methods through Fastboot or EDL (For power users, unlocking will give access to advanced features such as installing Google Camera on unofficial models or uninstalling system applications. MIUI.

Preparation of a computer and a smartphone

Before you start unlocking, make sure your PC and phone meet the minimum requirements. Your PC must have Windows 10/11 (64-bit) installed, as the official Mi Unlock Tool software does not support macOS or Linux.

  • πŸ”Œ Cable USB Type-C (original or certified) – Cheap cables can cause connection errors.
  • πŸ”‹ Charge of the smartphone battery at least 60% - discharge during the procedure will lead to failure.
  • πŸ“₯ Xiaomi drivers for Fastboot and ADB β€” Without them, the PC will not recognize the device in the desired mode.
  • πŸ› οΈ Archive with utilities: Mi Unlock Tool, Platform Tools (from Google), firmware for your model.

Pay special attention to drivers. If you previously connected Xiaomi to a PC, delete old drivers through the Device Manager (Portable Devices or Other Devices section). Then download the current version from the official Xiaomi website or use the universal Xiaomi Driver Installer package. To check the installation correctly, open the Command Prompt in the folder from the Platform Tools and type:

fastboot devices

If you see the serial number of the device, the drivers are set correctly. If not, try reconnecting the phone in Fastboot mode (clutch Volume Down + Power when the device is off).

πŸ’‘

If the Mi Unlock Tool gives you a "Couldn't unlock" error, try running the program on behalf of the administrator or temporarily disabling the antivirus. Some versions of Avast and Kaspersky block the utility.

Linking a Mi Account to a device

Since 2021, Xiaomi has tightened the unlock rules: now you need to link your Mi Account to your phone and wait 168 hours (7 days).This rule applies to all models released after the Redmi Note 9. If you bought the phone from hand, make sure that the previous owner untie your account in the Mi Account settings β†’ Delete the account.

To link the account:

  1. Turn on your smartphone and connect to the Internet (Wi-Fi or mobile network).
  2. Go to Settings β†’ Mi Account β†’ Sign in and log in.
  3. In the same section, activate the options: πŸ”— Synchronization of data (required!) πŸ” Search for a device (to confirm ownership)

Settings β†’ About the phone

MIUI version

Developer mode

Settings β†’ Additional β†’ For Developers

  • πŸ”§ Debugging by USB
  • πŸ”“ Unlocking OEM (major!)

After activating OEM Unlock, wait 7 days. This timer is reset when:

  • πŸ”„ Resetting to factory settings.
  • πŸ“± Fastboot or Recovery Fastboot.
  • πŸ”‹ Full battery discharge (below 2%).
πŸ“Š How long are you willing to wait for unlocking?
Week (standard deadline)
3-5 days (looking for workarounds)
1 day (needs urgently)
I was waiting, but it didn't work out.

Install Mi Unlock Tool and unlock the bootloader

After 7 days, you can start unlocking. Download the latest version of the Mi Unlock Tool from the official Xiaomi website (Unlock section). Importantly, use only the English version - Chinese builds may contain viruses or not work with global firmware.

Instructions for unlocking:

  1. Turn off the phone and put it in Fastboot mode (clip Volume Down + Power).
  2. Connect the device to the PC through USB-cable.
  3. Launch the Mi Unlock Tool and log in to the same Mi Account that is linked to your phone.
  4. The program will automatically determine the model of the device. Press Unlock.

If it went well, you'll see a message called Unlocked successfully, and now the bootloader is unlocked, and you can install custom firmware.

  • ⚠️ In some models (POCO F5, Xiaomi 13T) When you unlock it, you can trigger a rollback, and it will go back to the factory firmware when you first restart it. TWRP.
  • ⚠️ If the Mi Unlock Tool is a Couldn't Verify Device, check it out: πŸ”Œ Cable and port USB (Try the port USB 2.0 back-panel). πŸ”„ Reinstall drivers manually through Device Manager. πŸ“‘ Turn it off. VPN/Xiaomi servers can block suspicious IP.

β˜‘οΈ Checklist before unlocking

Done: 0 / 5

Installation of TWRP and custom firmware

Once the bootloader is unlocked, you can install custom recaps (TWRP) and firmware.

  • πŸ“± LineageOS, Pixel Experience or other custom firmware installations.
  • πŸ”§ Getting root rights through Magisk.
  • πŸ—‘οΈ Create a complete backup system (Nandroid backup).

Download the current version of TWRP for your model from the official website twrp.me. The file must have the extension.img.

  1. Place the TWRP file in the folder with Platform Tools.
  2. Open Command Prompt in this folder (Shift + right mouse button β†’ Open command window).
  3. Enter the command to check the connection: fastboot devices
  4. Install. TWRP Team: Fastboot Flash Recovery twrp-3.7.0_12-1-redmi_note_12.img (Replace the file name with yours).
  5. Immediately after installation, go to TWRP, holding Volume Up + Power. If you miss this step, the system will rewrite TWRP with standard Recovery.

In TWRP, the first thing you do is back up Boot, System, and Data, and that will save you if you have a bad firmware.

  1. Download firmware in.zip format (e.g. Pixel Experience for Redmi Note 11).
  2. Transfer the file to your phone or flash drive.
  3. In TWRP, select Install β†’ specify firmware β†’ Swipe to confirm.
  4. After installation, run Wipe β†’ Format Data (required for the first installation!).
What to do if TWRP is not installed?
If you see a FAILED error (remote: 'Not allowed in Lock State') when trying to flash TWRP, then the bootloader is not unlocked. Go back to the Mi Unlock Tool step. If the Invalid sparse file format at header error is, download another version of TWRP (your model may need a special build).

Unlocking without waiting 7 days: workarounds

Some models (such as the Redmi Note 10 Pro or the POCO X3 Pro) can bypass the 168-hour timer using EDL or Test Point modes. However, these methods require soldering work or special equipment and are only suitable for advanced users. A safer way is to use alternative tools like the XiaomiTool V2 or Mi Flash Unlock, but they do not work on all devices.

If you do decide to take a risk, here is a brief guide to EDL-method:

  1. Download the firmware for your model in.tgz format (for example, from the Xiaomi Firmware Updater website).
  2. Unpack the archive and find the file. prog_emmc_firehose.mbn (He's needed to work in EDL).
  3. Connect your phone to your PC in mode EDL: For most models: Turn off the phone, press Volume up + Loud down and plug in. USB-cable. POCO F3/F4: You will need to close Test Point (contacts on the motherboard).

Mi Flash Tool

flash_all_lock.bat

⚠️ Attention: Method EDL It can cause hard-brick if the wrong firmware is selected. IMEI and a serial number that will make the phone unusable for calls!

Unlocking through Fastboot: an alternative method

If the Mi Unlock Tool refuses to work, you can try unlocking the bootloader through Fastboot commands.This method works on older models (Redmi 5, Mi A1) and some new ones, but requires knowing the exact command for your firmware.

Major teams:

fastboot oem unlock


fastboot flashing unlock




fastboot oem unlock-go

For Xiaomi, fastboot flashing unlock is usually triggered, but some devices (such as the POCO X3 NFC) may require a combination of:

fastboot oem unlock


fastboot flashing unlock_critical

If the command is successful, the phone will reboot with the bootloader unlocked.

  • πŸ”΄ On newer models (Xiaomi 12 and newer), these commands can lock the device permanently.
  • πŸ”΄ Some firmware (MIUI 14) ignore Fastboot commands and require the Mi Unlock Tool to be used.

πŸ’‘

If you're not sure about the commands for your model, don't experiment. The official Mi Unlock Tool is the safest way, albeit with waiting.

Frequent mistakes and their solutions

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

Mistake.Reason.Decision
Couldn’t unlock (50%/99%)168 hours or the account is not tied.Check the account binding in Settings β†’ Mi Account.
Device not connectedProblems with drivers or cable.Try another one. USB-port or cable. Reinstall the drivers.
Anti-rollback checkTrying to install the old firmware.Download the firmware with a higher Anti-rollback number.
This device is lockedThe bootloader is not unlocked.Repeat the procedure with the Mi Unlock Tool.
Invalid IMEI after the firmwareThe modem section is damaged.Restore. IMEI through QCN-file META.

If none of the methods helped, go to the forums. XDA Developers or 4PDA β€” They often put up relevant solutions for specific models, like the Redmi Note. 12 A special script may be required. unlock_bootloader.bat, for POCO F5 β€” patchy TWRP.

Can I unlock Xiaomi without a computer?
No, unlocking the bootloader requires you to connect to your PC via the Mi Unlock Tool. However, you can reset your pattern lock or password via Recovery (if USB debugging is enabled) or service codes (for example, ##7378423## for resetting on some models).
What happens if you break the unlock?
If you interrupt the process at the Mi Unlock Tool stage, the phone can hang on the Mi logo or stop turning on. In most cases, it helps to restart the utility. If the device does not respond, try flashing it through the Fastboot command: fastboot flash all [firmwarename].zip
How to check if the bootloader is unlocked?
Turn off your phone and turn it on in Fastboot mode (clutch Volume Down + Power). At the bottom of the screen, the Unlocked or Open Lock icon should appear. You can also check with the command: fastboot oem device-info Look for the lines Device unlocked: true.
Can I return the guarantee after unlocking?
Technically, yes, if you return the standard firmware and lock the bootloader back. To do this: Sweep the official firmware through the Mi Flash Tool (select clean all and lock). In TWRP, run Wipe β†’ Format Data. Lock the bootloader with fastboot oem lock. However, Xiaomi service centers can detect traces of unlocking on the system logs, so the warranty can still be canceled.
Which Xiaomi models can’t be unlocked?
Since 2023, Xiaomi has completely blocked unlocking for some models released for the Chinese market (with the CN mark in the title). Among them: Xiaomi 13 Ultra (2304FPSCCN) Redmi K60 Pro (22127PC95C) POCO F5 Pro (23013PC75C) For global versions (Global/EEA), unlocking is usually available, but may require additional steps (for example, changing the firmware region).