The Xiaomi Mi 8, released in 2018, remains a popular smartphone among customization enthusiasts thanks to its powerful hardware (Snapdragon 845, 6/8 GB of RAM) and active community support. However, over time, official MIUI updates stop coming out, and users face brakes, bugs or the desire to install custom firmware like LineageOS or Pixel Experience.
In this guide, we will look at all the steps from unlocking the bootloader (a mandatory step for Xiaomi) to installing firmware via Fastboot or Recovery. We will focus on the choice of software versions (stable/global/Chinese), tools like Mi Flash Tool and OrangeFox Recovery, as well as typical errors that can turn a smartphone into a βbrick.β If you have never stitched through Xiaomi, start by exploring the section on unlocking the bootloader, as without this, further action is impossible.
1. Firmware Preparation: What You Need to Know Before You Start
Xiaomi Mi 8 firmware (codename dipper) requires preliminary preparation, otherwise the risk of damaging the device increases significantly. First and foremost: unlocking the bootloader - without this, no custom firmware will stand up. Xiaomi officially allows you to unlock the bootloader, but the process takes up to 720 hours (30 days) of waiting after you link the account. If you buy a used device, make sure that the previous owner did not tie it to his Mi Account - otherwise unlocking will be impossible without his help.
The second is firmware selection. For the Mi 8, you can:
- π¦ Officially MIUI: stable (recommended for everyday use) and development (weekly updates, but bugs are possible).
- π§ Custom firmware: LineageOS, Pixel Experience, Havoc-OS (requires an unlocked bootloader and custom recavery).
- π Localized versions: Global (Global), Chinese (China), European (EEA) β Different set of pre-installed applications and support for languages.
The third is backup. The firmware erases all data from internal memory, including photos, contacts and messages. Use Mi Cloud, Google Photos or a physical backup on your PC. Swift Backup (requires root rights) or Titanium Backup is the right way to save applications and their data.
β οΈ Note: If your Mi 8 was purchased in China, it is likely to be running China Stable firmware without Google Services, and installing a global version will solve the problem, but it will require a full Fastboot flashing.
2. Unlock the bootloader on Xiaomi Mi 8
Unlocking the bootloader on the Xiaomi Mi 8 is a mandatory step before installing any unofficial firmware. The process consists of two parts: linking the Mi Account to the device and actually unlocking through the Mi Unlock Tool. Importantly, since 2021, Xiaomi has tightened the rules, and now the waiting time is 30 days from the moment of attaching the account (previously it was 72 hours), this restriction is legally impossible to circumvent.
Instructions for unlocking:
- Link your Mi Account: Go to Settings β Mi Account β Sign in. Log in or create a new account (recommended to use email, not phone number). Enable data sync and find Device Status β Add account.
- Activate debugging on USB and OEM-Unlocking: Go to Settings β The phone. β Version. MIUI and tap the build number 7 times to activate Developer Mode. β Additionally. β For developers and include: π Debugging by USB π Unlocking OEM
- Install Mi Unlock Tool: Download the latest version of the utility from the official Xiaomi website (autonomy required). Run the program on a Windows PC (Linux/macOS Not supported) and log in to the same Mi Account as on your phone.
Connect your phone in Fastboot mode
1. Turn off the device.
2. Press Volume Down + Power before the Fastboot logo appears (robot with gear).
3. Connect the phone to the PC via the original USB- cable.Launch unlock.
- In Mi Unlock Tool, press Unlock.
- If you receive a waiting message (e.g., Wait 168 hours), wait until the deadline expires.
- After successful unlocking, the phone will reboot with reset settings.
β οΈ Warning: If the Mi Unlock Tool gives you a Couldn't unlock or Device not connected error, check: Is the original Xiaomi cable used (cheap cables often don't transmit data to Fastboot) USB Driver (download official website) Is the antivirus disabled (it can block the Mi Unlock Tool).
Mi Account is tied to the device|Debugging by USB and OEM-unlocking|Mi drivers installed USB Driver|The original cable is used.|Mi Unlock Tool downloaded from official website-->
3. firmware selection for Xiaomi Mi 8
The firmware choice is critical to the stability of the device, the availability of Google Services, and even battery life. There are three types of firmware available for the Mi 8:
| Type of firmware | Advantages | Deficiencies | Recommendations |
|---|---|---|---|
| Official MIUI (Global/EEA) | Stable work Support OTA-Updates Availability of Google Services | Advertising in system applications Limited customization opportunities | For everyday use without βdancing with diamondsβ |
| Official MIUI (China) | More frequent updates Less Bloatware (pre-installed applications) | No Google Services Chinese apps (e.g. Mi App Store) | Only if you are ready to install Google Services manually |
| Brush firmware (LineageOS, Pixel Experience) | Clean Android without ads Long-term support (updates even after the official end) Advanced settings (such as kernel management) | Possible bugs (for example, non-functioning) NFC or camera. No. OTA-Updates (must be hand-stitched) | For enthusiasts who are ready for experimentation |
Where to download firmware:
- π Officially MIUI: Xiaomi official website (choose Mi 8 or Dipper model).
- π Custom firmware: XDA Developers (section Mi 8). SourceForge (for LineageOS).
When choosing, pay attention to:
- π Assembly Date: Fresh firmware (2023β2026) is usually more stable.
- π Installation type: Fastboot (full firmware) or Recovery (update over an existing system).
- π The region is better suited for Russia Global or EEA (Europe).
π‘
Before downloading the firmware, check its hash (MD5 or SHA-256) using the HashMyFiles utility.
4. Firmware via Fastboot (Mi Flash Tool)
Fastboot is the most reliable way to flash the Xiaomi Mi 8, especially if the device is not turned on or requires a complete system reinstallation.
- π₯οΈ Windows PC (7/10/11).
- π Original. USB-cable.
- π Firmware in.tgz or.zip format (unpacked in a folder).
- π οΈ The Mi Flash Tool (you can download it here).
Step-by-step:
- Prepare the firmware: Download the firmware for Fastboot (for example, dipper_global_images_...). Unpack the archive in a folder without Cyrillic characters (for example, C:\Mi8_Fastboot).
- Install drivers: Connect your phone in Fastboot mode (clutch Volume Down + Power). In Windows Device Manager, check that the device is defined as Android Bootloader Interface.
- Launch Mi Flash Tool: Open the program on behalf of the administrator. Press Select and specify the path to the folder with the unpacked firmware. Select firmware mode: Clean all - complete cleaning (recommended). Clean all and lock - cleaning + lock the bootloader (do not choose if you plan custom firmware!). Save user data - save data (does not always work correctly).
Start the firmware
- Press Refresh β the device should appear in the list.
- Click Flash and wait until it is completed (usually 5-10 minutes).
- Once successful, the phone will reboot automatically.
β οΈ Note: If the Mi Flash Tool gives you flash not done or critical partition error, try: USB-cable to another port (preferably) USB Disable driver signature verification in Windows (via gpedit.msc). Use another version of the Mi Flash Tool (e.g., 20180528 instead of the latest one).
What to do if the Mi Flash Tool is 99% deaf?
5. Firmware via Recovery (TWRP/OrangeFox)
Installing firmware through Recovery is suitable for updating the system without full cleaning or installing custom firmware (for example, LineageOS). This requires custom recoveries - TWRP or OrangeFox. Official Mi Recovery does not support the installation of informal firmware.
Instructions for OrangeFox Recovery (recommended for Mi 8):
- Download Recovery: The latest version of OrangeFox for dipper can be found on the official website. The file will be in.img format (for example, the file will be in the format of.img, OrangeFox-R11.1_2-dipper.img).
- Install Recovery via Fastboot: 1. Connect your phone in Fastboot mode. 2. Open the command line in the folder with fastboot and execute: fastboot flash recovery OrangeFox-R11.1_2-dipper.img 3. Reboot to Recavator: Fastboot boot OrangeFox-R11.1_2-dipper.img
- Please. ZIP-Firmware: Copy the firmware file (for example, lineage-20-dipper-20260310.zip) On your phone or flash drive. In OrangeFox, select Install. β Select ZIP Swipe for confirmation and wait until it's done. Clear the cache. β Dalvik/ART Cache + Cache).
Reboot.
- Select Reboot β System.
- The first run can take up to 10 minutes β donβt interrupt the process!
The advantages of OrangeFox over TWRP:
- π§ Support MIUI OTA (You can update without losing data).
- π Built-in file manager with support NTFS exFAT.
- π Ability to backup to the cloud.
π‘
Castomic Recovery (TWRP/OrangeFox) allows you to install not only firmware, but also modifications of the kernel, Magisk for root rights, as well as create full system backups (Nandroid).
Typical errors and their solutions
Even if you follow the instructions exactly, Xiaomi Mi 8 firmware can end up in error.
| Mistake. | Reason. | Decision |
|---|---|---|
| This device is locked (in Fastboot) | The bootloader is not unlocked or locked after firmware is installed. | Re-unlock through the Mi Unlock Tool. If the bootloader is locked after firmware, unlock again (the wait of 30 days is not required). |
| Invalid sparse file format at header | A firmware file or incompatible version of the Mi Flash Tool is damaged. | Check the firmware hash (MD5). Use the Mi Flash Tool version 20180528. |
| The phone does not turn on after firmware (black screen) | Incorrect firmware (e.g., for another model) is selected, and it is an error to write to the boot or system partition. | Try stitching back with Clean all. If it doesn't work, run the official China Stable firmware through Fastboot (which often restores bricks). |
| E: Unknown command [log] (on TWRP) | Older version of RecavΓ©ri or damaged ZIP-file. | Update. TWRP/OrangeFox to the latest version. ZIP-file-in-file. |
If after firmware the device is loaded in a loop (bootloop):
- Load into Recovery (click Volume Up + Nutrition).
- Run Wipe β Format Data (this will delete all data, but often solves the problem).
- Refresh the firmware.
To diagnose problems, it is useful to look at the firmware log. In the Mi Flash Tool, it is stored in the folder with the program (log.txt file). In TWRP/OrangeFox, the log can be copied through Advanced β Copy Log.
7.Install Magisk and obtain root rights
If you need root rights (for example, to remove system applications or fine-tune the kernel), after firmware you can install Magisk. This is a universal tool for obtaining root without changing the systemless root, which allows you to pass the SafetyNet check (needed for banking applications).
Instructions for installation of Magisk:
- Download Magisk: The latest version can be found on GitHub (Magisk-v26.4.zip file).
- Install via receptacles: Copy Magisk-v26.4.zip to your phone. Download to OrangeFox/TWRP. Select Install β Magisk-v26.4.zip and swipe to install.
Reboot.
- After installation, select Reboot β System.
- Install. APK-Magisk file (downloads automatically to Downloads folder).
Checking the work of Magisk:
- Open the Magisk app and make sure all modules are loaded.
- Run SafetyNet if Pass root status is hidden from banking applications.
β οΈ Note: Installation of Magisk on the official firmware MIUI This can lead to blocking certain functions, such as: No support OTA-Some system applications (Mi Pay, Mi Fit) don't work, but for custom firmware (LineageOS), these restrictions don't apply.
8. Post-firmware optimization
After a successful firmware Xiaomi Mi 8 recommended to follow a few steps to improve performance and stability:
- π Cache reset: In Recovery, select Wipe β Dalvik/ART Cache + Cache.This eliminates possible lags after first download.
- β‘ Disabling unnecessary services: C Settings β Apps disable autorun for unnecessary system applications (e.g. Mi Video, Mi Music).For custom firmware, use AppOps (Hidden Android Settings) to limit background activity.
- π Kernel setup (for advanced users): Install Kernel Adiutor or FrancoKernel Manager to manage CPU frequencies and task scheduler. To save battery power, choose governor ondemand or conservative.
- π Security: If you installed Magisk, hide it from banking applications via Magisk Hide. ADB and OEM Unlock in the developer settings, unless you plan to further manipulate.
To check the stability of the system after firmware:
- Run Geekbench 6 or AnTuTu for performance evaluation.
- Check the operation of the main functions: πΆ Communication modules (Wi-Fi, Bluetooth, mobile network). πΈ Camera (check all modes, including night and portrait modes). π Charging (make sure the phone correctly detects the charger).
π‘
After running custom firmware (like LineageOS), it is recommended to calibrate the battery: completely discharge the phone, then charge to 100% without interruption, which will help the system correctly determine the level of charge.