Xiaomi’s current Android smartphones provide users with not only a standard interface, but also hidden deep customization capabilities. Developers and advanced enthusiasts use a toolkit known as ADB and Fastboot to access these features. These protocols allow the computer to communicate with the phone at a low level, bypassing the standard limitations of the graphics shell.
Using Xiaomi ADB Fastboot Tools provides access to removing pre-installed system debris, installing custom recavators, obtaining root rights and even flashing the device in case of software failures. However, working with the command line requires care and a clear understanding of the processes that are taking place. Any error in typing commands can lead to unstable operation of the gadget or complete loss of data.
In this guide, we will detail how to prepare the workplace, install the necessary drivers and master the basic commands to control your device. You will learn how to work differently, how to safely remove unnecessary applications and what to do if the phone has stopped responding to commands. It is critical to understand the difference between debugging mode and bootloader mode, since the commands for them work in different contexts.
Preparation of the working environment and installation of drivers
The first step to fully managing your smartphone is to create the right environment on your PC. Without drivers installed, the operating system simply won’t see the connected device in the right mode. You’ll need to download the official Platform Tools package from the Android developer site, which contains adb.exe and fastboot.exe executables.
Once the archive is loaded, it needs to be unpacked into the root folder of the drive, such as in C:\adb, to avoid problems with long paths and character encoding. Xiaomi devices often require a separate installation of Google USB Driver universal drivers or specialized drivers from the manufacturer, especially if you plan to work with Fastboot mode.
- 📱 Download the latest version of Platform Tools from the official repository of Android Developers.
- 💻 Unpack the archive in a folder without spaces and Cyrillic symbols on the way.
- 🔌 Connect your smartphone and install the system-proposed or manually selected drivers.
- ⚙️ Add the path to the tool folder to Windows environment variables for ease of call.
⚠️ Note: When installing drivers in the Device Manager, a security alert may be displayed. Ignoring this warning will result in the computer not being able to correctly identify the mode of operation of the phone.
💡
Use the original. USB-Cheap cables often only support charging and don't transmit data, which will cause errors when connecting.
Activation of the developer mode and debugging via USB
To allow external control, you need to activate the hidden menu of the developer. Standardly, this section is hidden from the eyes of the average user to avoid accidental changes in critical settings of the system. To activate, go to the Settings → About menu and quickly click on the MIUI version or OS version seven times.
When you're a developer, a new section will appear in the main settings menu, and that's where the USB Debugging switch is, and turning it on gives the computer access to the file system and console commands, and without that step, all connection attempts will only end with battery charging.
When you first connect to a new computer, a dialog box will appear on your smartphone screen asking for debugging permission, ticking “Always Allow from this computer” and clicking “OK,” which creates a unique RSA key that links a particular PC to a particular device, providing a basic level of security.
ADB Basic Commands for File and System Management
Android Debug Bridge works when the phone is on and loaded into the operating system, and it's the main tool for everyday tasks: installing apps, taking screenshots, copying logs, and removing system components, commands are entered at the command line or terminal after you first go to the tool folder.
One of the most useful features is the ability to install applications directly from your computer, bypassing the Play Market Store. This is especially true for regions where some services are limited, or for installing modified versions of programs. APK-file.
adb install -r application_name.apkIt's also often required to access a file system to back up important data or extract media files, and the adb pull command copies the file from phone to computer, and the adb push command downloads the file from computer to phone, which is faster and more stable than standard MTP protocol.
- 📂 Adb devices – displays the list of connected devices and their status.
- 📸 adb shell screencap -p /sdcard/screen.png — screenshot.
- 🔄 adb reboot – performs a soft reboot of the device.
- 🗑️ adb shell pm uninstall -k --user 0 package_name — remove the application for the current user.
⚠️ Note: The pm uninstall packet removal command does not require root rights, but removes the application only for the current user.
Working with Fastboot: firmware and unlock
Fastboot mode is a protocol lower than ADB. It works before the Android operating system boots and allows you to interact directly with flash memory partitions. In this mode, you can reflash the bootloader, restore the system partition or unlock the device to install custom software.
To enter this mode on the switched off Xiaomi phone, you need to press the volume button and connect USB-And you'll see a picture of a repairman with an android or a sign on the screen. FASTBOOT. The computer will define the device as the Android Bootloader Interface. ADB Not working, you need to use the fastboot prefix.
One of the key procedures for enthusiasts is unlocking the bootloader, which is officially done through Mi Unlock, but knowing the commands of Fastboot allows you to control the process in more detail, for example, the fastboot flashing unlock command initiates the unlock process, which will completely clear the data on the device.
What is EDL mode?
Table of main memory and command sections
Understanding the structure of memory partitions is critical when working with Fastboot. Each partition is responsible for a specific function: kernel loading, user data storage, system files or modem settings. Incorrect writing to a critical partition can turn a smartphone into a “brick”.
The table below shows the main sections that most often have to interact with, and the appropriate commands for checking their status or recording images.
| Section (Partition) | Description | Check-in team | Recording team |
|---|---|---|---|
| boot | System core and RAMdisk | fastboot getvar all | fastboot flash boot boot.img |
| recovery | Recovery menu | fastboot getvar recovery-version | fastboot flash recovery recovery.img |
| system | Main operating system | fastboot getvar system-size | fastboot flash system system.img |
| userdata | User data (photos, contacts) | fastboot getvar userdata-size | fastboot erase userdata |
💡
Writing an image in the boot or recovery section is the safest way to install custom recavers (such as TWRP) without completely flashing the phone.
Removing System Garbage and Bloatware
One of the main reasons Xiaomi owners use ADB tools is to clear the system of the imposed software. There are many applications in the MIUI and HyperOS firmware that cannot be removed in the standard way. They take up space, consume RAM and can transmit telemetry.
The deletion process begins with finding the name of the packet. With the adb shell pm list packages command, you can list all the packages installed. To narrow the search, use filters like Facebook or miui. Knowing the exact name of the packet, you can safely remove the unnecessary component.
adb shell pm uninstall -k --user 0 com.miui.analyticsThis particular command removes Xiaomi’s system analytics service, which collects device usage data. It’s important to proceed with caution: removing critical system packets (such as those associated with a phone or message) can lead to a cyclic bootloop.
- 🔍 Use adb shell pm list packages -s output only system applications.
- 🛡️ Before deleting, back up important data in case of a crash.
- 📦 To return a remote system application, use the command cmd package install-existing package_name.
⚠️ Note: Do not delete packages with framework, provider, or service in their name unless you know exactly what they are, and this can disrupt the entire operating system.
Diagnostics and solution
When working with console utilities, users often encounter connection errors, the most common problem is the status of unauthorized when executing the adb device command, which means that the phone is connected, but the debugging permission is not confirmed on the smartphone screen or the RSA keys are out of sync.
If the device is displayed as?????????????, it indicates a driver problem. In Windows Device Manager, you need to find an unknown device, select Update Driver, and point the path to the Android driver folder. SDK. Sometimes a simple shift helps. USB-port-line.
If the phone is stuck in Fastboot mode and doesn't leave it, a long power button (about 15-20 seconds) will help. The device must forcefully reboot. If the screen is black and there is no reaction, it may have gone into deep sleep or EDL mode, which requires a connection to the original charger.