Modern Xiaomi and Redmi smartphones provide users with ample opportunities for customization, but sometimes standard upgrade methods stop working. Situations where a device hangs on a logo, gets into an endless reboot or requires a rollback to a more stable version of the system are quite common. ADB (Android Debug Bridge โ a powerful debugging tool that allows you to interact with the operating system at a low level.
Console commands are superior to normal menu recovery, as they force partition images or send a firmware file directly to the device clipboard. However, this method requires increased care and accuracy of input data. A single-letter error or the use of an incompatible file can lead to serious consequences, up to the need for programmable firmware.
In this article, we will take a closer look at the preparation of your computer and smartphone, the drivers and utilities you need, how ADB differs from Fastboot, and where each of them is appropriate, and go all the way from enabling debugging over USB to the final command that brings the gadget back to life.
Preparation of tools and drivers for working with Android
Before any manipulation of system files begins, a stable connection between the PC and the mobile device must be ensured. USB-cable, preferably original, because cheap analogues often can not withstand long-term transfer of large amounts of data.
A critical component is installing the right drivers. Without them, the computer simply wonโt see the smartphone in the right mode. Xiaomi devices often require the installation of Qualcomm HS-USB QDLoader drivers (for EDL mode) or the standard Android Bootloader Interface.
โ ๏ธ Note: Installing drivers from unverified sources may lead to system infection or malfunction USB-Use only official packages. SDK or verified repositories.
The main tool will be the platform Platform-Tools from Google, which contains adb and fastboot utilities, and you should download it exclusively from the official Android developer site. After downloading the archive, you need to unpack it into the root folder of the disk, for example, in C:\platform-tools, to avoid problems with long paths.
- ๐ฑ Smartphone with a charged battery of at least 60%.
- ๐ป Computer with drivers installed ADB and Fastboot.
- ๐ Original. USB-cable.
- ๐ Firmware file (Fastboot) ROM in.tgz or Recovery format in.zip).
๐ก
Save all important data before starting the procedure, as firmware through ADB often involves a complete reset of user information.
Activation of debugging mode and obtaining access rights
By default, any Android smartphone blocks external connections for security purposes. In order for the computer to send commands, you need to activate the hidden developer menu. Go to Settings โ About Phone and quickly click 7 times on the field MIUI Version or OS Version.
Next, the settings menu will have a new option called โAdditionalโ or โExtended settingsโ where you need to find โDevelopersโ and the USB debugging switch is activated. When you first connect the cable to your PC, you will see a request for debugging permission on your smartphone screen โ be sure to check โAlways Allowโ and click โOK.โ
Some operations, especially those involving unlocking the bootloader or deep modification, may require extended rights. However, standard debugging is sufficient for standard firmware installation via ADB. If you plan to work with partitions, make sure that the device does not activate the device search (Mi Find Device), as this can block access.
Differences between ADB, Fastboot and Recovery
A common mistake for beginners is trying to execute ADB commands when the phone is in bootloader mode, or vice versa. Understanding the difference between these states is critical. ADB mode works when the operating system is running (or in Recovery mode), and allows you to manage files, install applications, and send shell commands.
Fastboot (or Bootloader) mode starts before the OS boots. In this state, you can reflash memory partitions, unlock the bootloader, and change system settings. Commands here are faster and have higher priority. This screen usually shows a hare in a jack hat fixing an android.
The third mode is Recovery, which is a separate mini-section designed to reset settings and install updates, and you can send a command to enter this mode through ADB, and the table below compares the main features of the modes:
| Parameter | ADB Mode | Fastboot Mode | Recovery Mode |
|---|---|---|---|
| Status of the OS | Downloaded or Recovery | Unloaded (bootloader) | Mini OS recovery |
| Access to files | Full access | Sections only. | Restricted access |
| Substantive function | Debugging, APK installation | Partition firmware, Unlock | Reset, Update ZIP |
| Entry command | adb reboot bootloader | Volume buttons + power | adb reboot recovery |
The choice of firmware depends on the state of your device. If the phone turns on and is visible to the computer, use ADB Sideload. If the system does not load, but the bootloader is running, go to Fastboot. If the device does not respond to buttons, you may need to use EDL mode, which on modern Xiaomi is often closed by an authorized account.
Step-by-step instructions for installing Recovery firmware through Sideload
ADB Sideload is the most versatile way to install official updates or custom recavators when the standard menu path is not available. First, you need to load the phone into Recovery mode. This can be done softwarely by typing adb reboot recovery into the command line, or hardwarely by holding down the volume and power button.
In the recovery menu (usually OrangeFox, TWRP or stock MIUI Recovery), you need to find the item "Apply Update" or "Connect via ADB." After selecting this item, the phone will go to standby connection. On the computer in the tool folder, open the console and check the connection with the adb device command. You should see the serial number of the device with the sideload name.
โ๏ธ Checklist before Sideload launch
Now you can start transferring the file. The command is as follows:
adb sideload name file firmware.zipOnce you input the command, you start the data transfer process, you get a percentage progress scale on your smartphone screen, and it's important not to interrupt this process, and you don't pull the cable, and once you've finished the transmission, the device will automatically start the installation or prompt you to confirm the action on the screen.
โ ๏ธ Note: If progress is frozen 47% or 94% and no longer moves 2-3 It can mean a file signature checker error. Don't interrupt the process right away, sometimes the system just checks the checksums.
Successful completion of the procedure will be marked by the message "Total xfer" in the console and the phone restart. If the device is left in recovery mode, select "Reboot System Now." The first boot after the firmware can take up to 10-15 minutes, which is normal for the application optimization process.
Firmware partitions in Fastboot mode via ADB
If you want to flash a specific image (such as boot.img or recovery.img) or perform a full flashing through Fastboot, the algorithm changes. Put your smartphone into Fastboot mode by holding down the volume button when the screen is off, or through the adb reboot bootloader command. Make sure the console displays the status of the device: fastboot.
For a separate partition, you use the fastboot flash command, for example, to install a custom Recovery, the command will look like this:
fastboot flash recovery recovery_image_name.imgFor full flashing of the device, a script file (bat for Windows or sh for Linux/Mac) is often used, which contains a sequence of commands for all partitions, and such scripts should only be run from trusted sources, since they may contain commands for formatting user data.
- ๐ fastboot flash boot boot.img โ core-fixing.
- ๐พ fastboot flash system system.img โ system-partitioning.
- ๐ fastboot reboot โ Reboot the device.
- ๐งน fastboot erase cache โ cache cleaning (use with caution).
What do you do when you write โWaiting for Deviceโ?
It is important to understand that Fastboot requires an unlocked bootloader on global firmware versions. If the bootloader is locked, commands will be rejected with an error.
Possible errors and methods of their elimination
The flashing process rarely goes perfectly smoothly the first time. One common problem is the signature mismatch error. It occurs when you try to install firmware designed for another region or version (e.g. Global to China or vice versa) without first changing the region or unlocking, in which case the security system blocks the installation.
Another common problem is that the connection breaks in the middle of the process, and if it happens in Sideload mode, it's often enough to repeat the procedure again, and if it happens when you write partitions to Fastboot, the device may stop turning on, and then only logging into recovery mode or EDL mode for full flashing.
โ ๏ธ Warning: Never turn off the cable USB when the indicator of recording or data transfer flashing in Fastboot mode, this can damage the partition table, which makes recovery through standard means impossible.
Users also face the fact that the computer simply cannot see the device, and in addition to drivers, the reason may be the blocking of ports by antivirus or Windows security policies, try temporarily disabling the antivirus and running the console on behalf of the administrator.
๐ก
90% of errors in the firmware through ADB associated with drivers or damaged USB-cable, not with the smartphone itself.
If the phone goes into a bootloop after firmware, try resetting the data via Recovery, which will delete all user files, but often solves compatibility issues with the old configuration.