How to flash Xiaomi Mi 5: all ways to unlock the bootloader

Xiaomi Mi 5 is the legendary flagship of 2016, which is still popular thanks to the powerful hardware (Snapdragon 820, 3/4 GB of RAM) and the ability to install custom firmware. However, with the release of new versions of MIUI and Android owners are faced with the need to reflash: someone wants to upgrade to the current version, someone to install LineageOS to extend the life of the device, and someone needs to restore the โ€œbrickโ€ after an unsuccessful update.

In this guide, we will analyze all the current methods of firmware (via Fastboot, TWRP staffed MIUI Updater, tell you how to unlock the bootloader without errors, and warn against typical errors that will turn your Mi. 5 In the brick, we'll focus on Android-based firmware. 10/11 โ€” The latest supported versions for this model, as official support has long since ceased.

1. Firmware Preparation: What to Do Before You Start

Xiaomi Mi 5 firmware is not a complicated process, but it requires preparation. Without it, you risk getting a device that doesn't turn on or constantly restarts.

  • ๐Ÿ”‹ Charge the battery to at least 60%. When discharged during firmware through Fastboot, the device can "brickยป.
  • ๐Ÿ“ฑ Backup important data. The firmware erases internal memory (except for a microSD card if installed).
  • ๐Ÿ–ฅ๏ธ Install drivers for Xiaomi on PC. Without them, the computer will not see the phone in Fastboot mode.
  • ๐Ÿ”“ Unlock the bootloader (unlocked) without it custom firmware and even some official will not install.

Pay special attention to the choice of firmware. For Mi 5 (codename gemini) suitable:

  • ๐Ÿ“ฆ Official firmware MIUI (Developer and stable versions before MIUI 12.5 based on Android 10).
  • ๐Ÿค– Castom firmware: LineageOS 18.1 (Android 11), Pixel Experience, Havoc-OS.
  • โš ๏ธ Unofficial ports of Android 12+ โ€” work with bugs (camera, sensors, mobile network).

โš ๏ธ Attention: Firmware for Mi 5s (capricorn or Mi capricorn 5s Plus (natrium) is not suitable for the Mi 5! Installing incompatible firmware will cause the device to fail completely.

Also check the current version of MIUI and Android in settings (Settings โ†’ About Phone).If you have a MIUI 8/9 on Android 6.0, an interim upgrade to MIUI 10 may be required before running through Fastboot.

๐Ÿ“Š What firmware you plan to install on Xiaomi Mi 5?
Official MIUI (Stable)
Official MIUI (Development)
LineageOS (Pixel Experience)
Another.

2 Unlock the bootloader: without it anywhere

The Xiaomi Mi 5 factory firmware has a bootloader locked, which means you can't install custom recavators (TWRP) or unofficial firmware until you unlock it, taking 3 to 720 hours (yes, it's not a typo) and requires a Mi Account to be linked.

Here's the step-by-step instruction:

  1. Link your Mi Account to your phone: Go to Settings โ†’ Mi Account. Sign in or create a new account. Enable sync and confirm the link via SMS.
  2. Activate USB debugging: Open Settings โ†’ About Phone. Click 7 times on MIUI to turn on Developer Mode. Return to Settings โ†’ Additional โ†’ Developer. Enable USB Debugging and OEM Unlock.

Request unlocking via Mi Unlock

  • Download Mi Unlock Tool from the official website.
  • Launch the utility on your PC, log in under the same Mi Account.
  • Connect your phone in Fastboot mode (turn off the phone, then press Volume Down + Power).
  • Press Unlock and wait for the process to be completed.

Once successfully unlocked, the phone will automatically reset to factory settings. Don't worry, that's okay. Now you can install any firmware and recoveries.

โš ๏ธ Warning: If you see a "Couldn't unlock" or "Device not bound" error when you unlock, then your Mi Account is not tied to your phone or 720 hours have passed since your last unlock.

Linked to Mi Account on phone|Debugging is on. USB|Unlocking enabled OEM|Installed drivers Xiaomi on PC|The phone is charged at more than 60%-->

3. Firmware through Fastboot: the official way from Xiaomi

Fastboot is the most reliable method for installing official MIUI firmware (stable or development) because it is signed by Xiaomi and tested for compatibility, minus all data from internal memory.

You'll need:

  • ๐Ÿ–ฅ๏ธ Windows computer (or Linux/macOS with fastboot and adb installed).
  • ๐Ÿ“ฑ Cable USB Type-C (preferably original).
  • ๐Ÿ“ The firmware in.tgz format for your model (gemini.
  • ๐Ÿ› ๏ธ The Mi Flash Tool (download here).

Step-by-step:

  1. Unpack firmware from the.tgz archive into a folder without Cyrillic characters (for example, C:\Mi5_firmware\).
  2. Install the Mi Flash Tool and run it on behalf of the administrator.
  3. Connect your phone in Fastboot mode: Turn off your phone. Press Volume down + Power before the Fastboot logo appears.

In the Mi Flash Tool

  • Press Select and specify the folder with the unpacked firmware.
  • Select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  • Press Flash and wait until it is completed (5-10 minutes).

Once the firmware is successful, the phone will automatically restart. The first run can take up to 15 minutes - don't interrupt the process!

Firmware mode in Mi FlashWhat's he doing?When to use
Clean allDeletes all data, flashes the systemWhen changing the MIUI version or after resetting
Clean all and lockDeletes data + blocks the loaderOnly if you need to return the phone to the โ€œfactoryโ€ state
Save user dataSwitching the system without deleting dataUpdate only within one MIUI branch

โš ๏ธ Note: If after firmware the phone is stuck on the logo MI It's more than 20 minutes, so the firmware is not suitable for your version of the bootloader. MIUI (for example, MIUI 10 before MIUI 12).

๐Ÿ’ก

If the Mi Flash Tool doesnโ€™t see the phone, try reinstalling the drivers manually through Device Manager (select โ€œXiaomi Mi Composite MDB Interfaceโ€).

4. Installation of TWRP and custom firmware

If you want to install LineageOS, Pixel Experience or other custom firmware, you will need TWRP recavators. This is an alternative restore menu that allows you to stitch informal images.

Here's how to do it:

  1. Download TWRP for Mi 5: Official: twrp.me. or unofficial (like OrangeFox) - look up the XDA Developers forum.
  2. Please. TWRP Fastboot: Fastboot Flash Recovery twrp-3.7.0_9-0-gemini.img fastboot boot twrp-3.7.0_9-0-gemini.img After the second command, the phone will be loaded into TWRP.
  3. Backup in TWRP: Go to Backup. Mark Boot, System, Data. Swipe to backup (save it to a memory card or PC).

Sweep through the custom firmware

  • Copy the firmware (.zip format) on the phone.
  • In TWRP, select Install โ†’ Select file โ†’ Swipe to confirm.
  • After installation, run Wipe โ†’ Format Data (if required in the firmware instructions).

For Mi 5, we recommend the following custom firmware:

  • ๐Ÿ“ฑ LineageOS 18.1 (Android 11) is the most stable.
  • ๐Ÿ“ฑ Pixel Experience โ€“ pure Android with Google Pixel chips.
  • ๐Ÿ“ฑ Havoc-OS โ€“ Maximum customization.

โš ๏ธ Note: After installing custom firmware, do not update through OTA! This can lead to a logo hanging, and install all updates only through the logo. TWRP.

How to return the official MIUI after custom firmware?
1. Download the official firmware in.tgz format and unpack it. 2. Use the Mi Flash Tool in Clean All mode. 3. If the phone doesnโ€™t boot, repeat the firmware with the signature check disabled (fastboot flash). disable_verity and disable_verification). 4. After a successful boot, unlock the bootloader again (if necessary).

5. firmware via MIUI Updater (no PC)

If you donโ€™t want to mess with Fastboot or TWRP, you can upgrade your firmware directly from your phone through the regular MIUI Updater app, which is only suitable for official MIUI firmware and works if:

  • ๐Ÿ“ฒ You already have an official firmware installed.
  • ๐Ÿ”“ The loader is unlocked (for transitions between branches) MIUI).
  • ๐Ÿ“ถ There is a stable connection to Wi-Fi.

Instructions:

  1. Open the application Update (MIUI Updater).
  2. Click on the icon ยซโ‹ฎยป (three points) in upper right corner.
  3. Select Select a firmware file.
  4. Specify the downloaded firmware file (.zip format).
  5. Confirm the installation and wait for the reboot.

If you update within a single branch (e.g. MIUI 12 โ†’ MIUI 12.5), the data will not be erased. When you change the branch (e.g. MIUI 10 โ†’ MIUI 12), reset to factory settings after the update.

โš ๏ธ Note: If, after updating, through MIUI Updater phone is stuck on startup boot, try to go to Recovery (click Volume up) + Power) and make Wipe Data. If that doesn't work, go through the Fastboot.

๐Ÿ’ก

Firmware via MIUI Updater is the easiest way, but it only works for official updates and requires an unlocked bootloader to change MIUI branches.

6.Typical errors and how to fix them

Even with strict adherence to the instructions, there can be problems, and here are the most common errors in the firmware Xiaomi Mi 5 and how to solve them:

Mistake.Reason.Decision
Fastboot: FAILED (remote: 'Flashing is not allowed in Lock State')bootloader lockedUnlock the bootloader through the Mi Unlock Tool
The phone does not turn on after firmware (black screen)Incompatible firmware or interrupted processMake it official. MIUI Fastboot is in Clean All mode.
E: Footer is wrong or E: Signature verification failed in TWRPA damaged firmware file or incorrect signatureDownload the firmware again, check the checksum (MD5)
Hanging on the MI logo after firmwareVersion conflict or uncleaned cacheGo to TWRP and make Wipe โ†’ Format Data
Mi Flash: "Flash Done. Reboot" but the phone doesn't turn onThe firmware is not suitable for the current version of the loaderSweep through the intermediate version (e.g. MIUI 10 before MIUI 12)

If none of these methods worked, try putting your phone in. EDL-This will require a box (Mi Flash Pro or UFi Box) or a special cable. This method is more complex and requires experience, so you should contact the service center.

Also check the battery status. If it is swollen or worn out, the phone may shut down during firmware, which will lead to "bricking".

7. How to check the success of the firmware

After the firmware, it's important to make sure that everything goes well and the phone is stable.

  1. Check the firmware version: Go to Settings โ†’ About the phone. Compare the MIUI and Android version to the one you installed.
  2. Test the basic functions: ๐Ÿ“ž Mobile and mobile phone calls (check both) SIM-cards, if any). ๐Ÿ“ท Camera (front and main). ๐Ÿ”Š Sound (speakers, microphone, headphones). ๐Ÿ“ถ Wi-Fi, Bluetooth, GPS. ๐Ÿ”‹ Charging (connect the charger).

Check stability

  • Reboot your phone 2-3 times.
  • Run multiple applications at the same time.
  • Play a game (like PUBG Mobile or Genshin Impact) to test the performance.

If you have installed custom firmware, pay attention to:

  • ๐Ÿ”‹ Battery consumption โ€“ some custom firmware can drain the battery faster.
  • ๐Ÿ“ก Mobile network operation โ€“ there may be problems with VoLTE or on unofficial firmware 4G.
  • ๐Ÿ”’ Security โ€“ custom firmware is not certified by Google, so SafetyNet may not work (issues with banking applications).

โš ๏ธ Note: If the phone gets too hot or discharges quickly after firmware, it is likely that the firmware is not optimized for the Mi 5. MIUI.

FAQ: Frequent questions about the firmware Xiaomi Mi 5

Can I flash Mi 5 without unlocking the bootloader?
No, without unlocking, you can only install official updates through MIUI Updater within a single firmware branch. Unlock is required to change the MIUI version (for example, from MIUI 10 to MIUI 12) or install custom firmware.
What is the safest way to make a newcomer?
For beginners, we recommend that you use the Mi Flash Tool in Clean All mode with the official firmware, which is minimally risky, since the firmware is signed by Xiaomi and checked for compatibility, the main thing is not to interrupt the process and use the correct firmware version for the gemini model.
What to do if there is no network after the firmware (does not catch) SIM-map)?
This problem most often occurs on custom firmware: Try: Reflash the firmware with full cleaning (Format Data in TWRP); install a patch for the modem (look for the XDA or 4PDA forum for your firmware); return to the official MIUI - if the problem remains, the modem may be faulty (repair required).
Can I flash Mi 5 on Android 12 or later?
Technically, yes, but such firmware (LineageOS 19+, ArrowOS 12) work with critical bugs: Camera is not working (or partially working). Mobile network problems (VoLTE, 4G). Strong battery life. We recommend you to stop with Android 11 (LineageOS 18.1), as this is the last more or less stable version for the Mi 5.
How to bring your phone back to life if it becomes a brick?
If the phone doesn't turn on and doesn't respond to buttons, try: Swipe through Fastboot the official firmware in Clean all mode. EDL-Mode (requires a special cable or box) Contact the service center if the first two methods did not work. In most cases, the Mi 5 can be restored, because it does not lock. EDL-The port (unlike the new Xiaomi models).