Xiaomi smartphone owners often face the desire to free the device from intrusive advertising and redundant system applications. The standard shell of MIUI, and now HyperOS, offers a variety of features, but often seems overloaded for those who appreciate the minimalism and speed of pure Android. The process of replacing the software environment can seem difficult, but with the right approach it is available even to beginners.
Switching to Stock Android or custom builds like LineageOS drastically changes the experience of using the gadget: you get the interface as close as possible to the reference Google Pixel, unnecessary processes disappear, and autonomy often increases. However, before starting the procedure, it is important to be aware of the risks associated with loss of warranty and the possibility of software failure of the device.
In this article, we will look at all the steps from unlocking the bootloader to the final installation of the new operating system. We will look at the necessary tools, ways to back up data and typical errors that can occur in the process. Flashing changes the software partition of the device forever, so attention at every step is critical.
Preparation of the device and choice of firmware
The first step is to find the right system image for your particular model. You can't just pick up any firmware, because the CPU and communication drivers are unique to each device. Usually users choose between official global versions without unnecessary apps or custom builds like LineageOS, Pixel Experience or ArrowOS.
You need to download all the required files to your computer in advance. You will need a firmware archive (usually in.zip or.img format), ADB and Fastboot drivers, and a utility to unlock the Mi Unlock Tool. Make sure that the battery charge of the smartphone is at least 60% so that the device does not turn off at a critical moment.
Make a full backup of all important data. The clean system installation process involves completely removing all the contents of internal memory, and it is better to save photos, contacts and documents to a cloud service or external hard drive.
- π± Download the firmware image strictly for your model (codename of the device).
- π» Install the drivers. ADB/Fastboot on a Windows or Linux computer.
- π Create a Mi Account and link it to your phone.
- π Copy the firmware file into the internal memory of the smartphone before starting.
β οΈ Note: Using firmware from other models or interrupting the recording process may make it impossible to turn on the phone (brick).
Unlocking the bootloader (Bootloader)
Xiaomi blocks the bootloader by default, which does not allow you to make changes to the system partition. To start work, you must apply for unlocking through the official MIUI website. After approval of the application (which can go from 3 to 30 days), the corresponding option will appear in the phone settings.
Activate Developer Mode by pressing the build number seven times in the About Phone section. Then, in the Advanced Settings menu, find the bootloader status and turn it on. After that, the smartphone must be switched to Fastboot mode, holding down the volume and power buttons simultaneously when the screen is off.
Connect the device to your PC and run the Mi Unlock Tool. The program will check the status of the account and, if all the conditions are met, prompt you to unlock the device.
Installation of drivers and setting up the ADB environment
Successful communication between your computer and smartphone requires a proper setup of the development environment. Standard Windows drivers often do not recognize the device in boot mode, so it is better to install the universal Minimal ADB and Fastboot package or platform tools from Google.
Once installed, open the command line in the tool folder. Enter the adb device command to check the phone's visibility in normal mode. If a debugging resolution message appears on your smartphone screen, confirm it.
To enter firmware mode, use the command adb reboot bootloader. In Fastboot mode, the connection is checked by the fastboot device command. If the serial number of the device is displayed in the list, then the connection is established and you can proceed to the next step.
adb reboot bootloader
fastboot flash recovery recovery.img
fastboot reboot recoveryClean Android installation process via Recovery
There are two main ways to install it: through custom recavatories (TWRP) or directly through Fastboot. The first is more flexible and allows you to make backups, the second is faster, but requires accuracy. Consider installation via TWRP, because it is the most popular among enthusiasts.
First, you need to flash the image of the recovery itself. Put the downloaded twrp.img file in the folder with ADB. Use the command line to run the firmware command. Once you record it successfully, the phone will automatically go to recovery mode. If that doesn't happen, press the volume and power buttons manually.
From the TWRP menu, select βWipeβ and clean up the Dalvik, Cache, System, and Data partitions. Donβt format your internal memory completely unless you want to lose files you havenβt copied before. Then go to Install, select an archive with pure Android firmware, and confirm the swipe installation.
βοΈ Checklist before firmware
Comparison of firmware methods: Fastboot and Recovery
The choice of method depends on your goals and level of training. Direct firmware via Fastboot is often used to return to the official version or install global builds, while Recovery is indispensable for customization.
Fastboot requires unpacking the firmware archive and alternately recording each partition, which can take a long time and increase the risk of user error. Recovery is simpler, since all actions are performed by one archive, but requires a pre-installed modified bootloader.
Below is a table that helps to determine the choice of installation method depending on the situation and the desired result.
| Parameter | Fastboot (Cleanflash) | Recovery (TWRP) | OTA Update |
|---|---|---|---|
| Difficulty | Tall. | Medium | Low. |
| Loss of data | Complete. | Full (at Wipe) | Data retention |
| Flexibility | Low. | Tall. | Absent. |
| Risk of error | Medium. | Low. | Minimum |
What to do if the phone goes into a bootloop?
First start and initial setup
Once the new system is successfully installed, the phone will restart. The first launch can take 5 to 15 minutes as the system optimizes applications and creates the necessary caches. Don't panic if the screen stays black for long or the Android logo hangs.
Go through Google's standard setup procedure. Choose a language, connect to Wi-Fi, and log in to your account. Because it's pure Android, you'll be offered a minimal set of settings, which is a lot faster than MIUI.
It is recommended to immediately check the operation of the main modules: camera, microphone, speakers and fingerprint sensor. Sometimes, for the correct operation of specific Xiaomi functions (for example, an IR port or dual tap) may require the installation of additional patches or modules Magisk.
π‘
After the first run, disable geolocation and personalization of ads in Google settings to preserve the privacy you gained by opting out of MIUI.
Possible problems and ways to solve them
Even with all the instructions, there can be unforeseen situations: Often users experience VoLTE or notification issues, which is because pure Android does not contain the proprietary Xiaomi services needed for some features.
If the camera shoots worse than before, make sure you install the correct version of GCam (Google Camera) adapted to your device's sensor.The standard camera app in custom firmware is often not fully disclosed.
If you have a network or Bluetooth bug, try resetting your network settings or reflashing the modem separately, sometimes cleaning the Daltonvik cache through the Recovery menu helps.
β οΈ Note: Some banking applications may not work on the unlocked bootloader. SafetyNet/Play Integrity will require the installation of Magisk and special modules hiding root rights.
π‘
The transition to pure Android returns the phone to the performance of the flagship, but requires readiness for independent resolution of small software conflicts.