Regime. ADB (Android Debug Bridge is a powerful tool for debugging and managing Android devices, including Xiaomi smartphones, tablets and TVs. With it, you can install custom firmware, get root rights, restore "bricks", test applications and even unlock hidden functions. MIUI or HyperOS. But the setup is wrong. ADB It can cause data loss or software failures β so itβs important to follow proven instructions.
In this article, we will discuss the whole process from enabling debugging to USB on a locked device before performing basic commands through the terminal. MIUI (including HyperOS, common bug solutions (e.g. device unauthorized or no permissions) and security when working with the device ADB. If you are a beginner, donβt worry: we will explain each step in as much detail as possible, with illustrations and warnings about possible risks.
What is ADB and why is it needed for Xiaomi?
ADB It stands for Android Debug Bridge, which is part of Android. SDK, It allows you to interact with your device via the command line. ADB used:
- π§ Unlock bootloader before installing custom firmware (e.g. LineageOS or Pixel Experience).
- π± Remove embedded applications (bloatware) that cannot be uninstalled in standard ways.
- π Restore the device after a βsoft breezeβ (for example, when the smartphone hovers on the Mi logo).
- π― Testing applications in developer mode or debugging performance.
- π Bypassing certain restrictions MIUI (for example, locking the installation APK source).
On Xiaomi Mi TVs TV or Redmi Smart TV ADB allows you to install third-party launchers (for example, ATV Launcher, adjust screen resolution manually or even run Kodi with full rights. ADB β For example, some TVs with an Amlogic processor may require additional firmware.
β οΈ Attention: Use ADB On devices with HyperOS (new shell Xiaomi) may differ from MIUI. For example, HyperOS has disabled access to some system commands via ADB loader-free.
Before you start setting up, make sure your device is not warranty β any manipulations through the ADB You can also back up your important data: if you have incorrect commands, you may be at risk of resetting your settings.
Preparation of the device: the inclusion of debugging by USB
To connect to the device through ADB, First you need to activate the developer mode and enable debugging by USB. The process is slightly different depending on the version. MIUI HyperOS, but the general scheme is as follows:
- Open the Settings. β About the phone (or About the tablet / About TV).
- Find the item Version. MIUI (or HyperOS version) and tap it 7 times in a row until the notification βYou became a developerβ appears!".
- Return to the main settings menu β there will be a new section for developers (or additionally). β Developer settings on HyperOS).
- Turn on the debugging switch. USB Confirm the action in the dialog window.
- Activate the option to Allow Unlock OEM (necessary to unlock the loader).
On Xiaomi TVs, the path may be different:
- πΊ Go to Settings. β The device β About the device β POS version.
- π Slip the Software Version 7 times, then come back and find it for developers.
- π Turn on Debugging. USB Debugging over the network (if you plan to connect over Wi-Fi).
β οΈ Note: On some TV models (e.g. Mi) TV 4S or Redmi Smart TV X) Debugging option USB It may be hidden, but you'll need to install it first. ADB Driver on PC and connect in blind mode via the command adb devices.
After activating debugging, connect the device to the computer through USB-cable (preferably original) will be asked to debug on your smartphone or TV screen β be sure to tick "Always allow from this computer" and click Allow.
βοΈ Preparation for work with ADB
Installation ADB on the computer: drivers and tools
To work with ADB PC-should be required:
- Install drivers for your Xiaomi device (unless Windows recognizes them automatically).
- Download the Android platform SDK Platform-Tools (the official Google package, including adb.exe and fastboot.exe).
- Add a path to ADB (b) environment variables (optional, but simplifies the work).
Download Platform-Tools from the official Google website: https://developer.android.com/studio/releases/platform-tools. Unpack the archive in a convenient folder (for example, C:\platform-tools).
To install drivers on Windows:
- π₯οΈ Connect the device to the PC and wait for attempts to automatically install drivers.
- π§ If the driver is not found, download Mi USB Driver from Xiaomi or use Universal Google USB Driver.
- π In Device Manager, find your device (can be displayed as Android or Other devices), update the driver manually, specifying the folder with the downloaded drivers.
Check the connection by opening the command line (Win) + R β cmd and introducing:
adb devicesIf the device is displayed in the list (for example, 1234abcd Device: Successful connection. If you see unauthorized, you have not been given permission to debug the device (check the notification on the smartphone/TV screen).
π‘
If the adb command is not recognized, specify the full path to the file, for example: C:\platform-tools\adb Or add the platform-tools folder to the environment variable. PATH via the control panel β System system β Additional system parameters β Environment variables
The main ADB teams for Xiaomi: what can be done
Once successfully connected, you can execute commands through the terminal, and here are the most useful for Xiaomi devices:
| Team team. | Description | Example of use |
|---|---|---|
| adb devices | Shows a list of connected devices | adb devices -l (supplementary) |
| adb shell | Opens the shell of the device to execute commands | adb shell ls /system/app (viewing of system applications) |
| adb install | Set up APK-file | adb install app.apk |
| adb uninstall | Remove the application by batch name | adb uninstall com.miui.weather (remove the weather) MIUI) |
| adb pull | Copies a file from a device to a PC | adb pull /sdcard/DCIM/photo.jpg C:\Photos\ |
For HyperOS devices, some commands may require root rights, for example, trying to uninstall a system application without unlocking the bootloader will result in an Operation not allowed error.
Example of uninstalling an embedded application (e.g., Mi Browser):
adb shell
pm uninstall -k --user 0 com.android.browserβ οΈ Warning: Removing system applications may disrupt stability MIUI/HyperOS. Before deleting, back up your copy via adb backup or TWRP (if established).
On Xiaomi TVs, commands are useful for controlling screen resolution or installing third-party launchers:
adb shell wm size 1920x1080 # Changes resolution
adb shell am start -n com.android.tv.settings/.MainSettings # Opens TV settingsHow to return a remote system application?
Unlocking the loader through ADB and Fastboot
For full access to system commands (e.g. firmware) TWRP Xiaomi officially allows this, but the process requires confirmation through the Mi Account account.
Steps to unlock:
- Connect your device to your Mi Account in settings (Accounts) β Mi Account).
- Go to the site. https://en.miui.com/unlock/ Download the Mi Unlock Tool.
- Launch the utility, log in to your Mi Account and follow the instructions. The device should be in Fastboot mode (click Power). + Volume down when the phone is off).
- Wait 72β168 hours (depending on Xiaomiβs policy) is a mandatory waiting time for new accounts.
After unlocking, you can stitch TWRP Or custom firmware through fastboot. Example of a command for firmware recaveri:
fastboot flash recovery twrp.img
fastboot boot twrp.imgβ οΈ Warning: Unlocking the bootloader completely resets the device (deletes all data, including photos and apps). L1 (downgrade DRM), Why Netflix or Disney?+ They will work in low resolution.
On some devices (e.g. Xiaomi) 12T Or the Redmi Note 12 Pro.+) After unlocking, you may need to additionally configure anti-rollback protection against rollback on the old version. MIUI. Check the current information on the forum XDA Developers for your model.
π‘
Unlocking the bootloader is an irreversible process, and even after blocking it again, some functions (such as Mi Pay or banking apps) may not work properly.
Solving typical mistakes ADB Xiaomi
When working with ADB Users often encounter errors. Here are the most common ways to fix them:
| Mistake. | Reason. | Decision |
|---|---|---|
| device unauthorized | No permission is given to debug on the device | Disconnect / connect the cable and confirm the request on the smartphone screen |
| no devices/emulators found | Drivers are not installed or the cable is faulty | Check the connection, install the drivers manually |
| adbd cannot run as root | ADB rootless | Unlock the bootloader and flash Magisk for root |
| protocol fault (no status) | Conflict of versions ADB | Update Platform-Tools to the latest version |
If the device is not defined in adb devices, but is defined in fastboot devices, it is in bootloader mode. To return to normal mode, type:
fastboot rebootXiaomi TVs have a common problem - adb: failed to get feature set: no devices/emulators This is because the debugging of USB TV only works through the port. OTG (Not all models support it. The alternative is Wi-Fi debugging:
adb tcpip 5555
adb connect 192.168.x.x:5555 # Replace your TV with IPπ‘
If ADB It stopped working after the update. MIUI/HyperOS, Try to turn off and re-enable debugging USB, and also update the Platform-Tools.
ADB Wi-Fi: How to connect without cable
Wi-Fi debugging is convenient if you often work with the Internet. ADB You don't want to plug in the cable:
- Connect the device to the PC by USB and do it:
adb tcpip 5555- Turn off the cable and find it. IP-device address in Wi-Fi settings.
- Connect to Wi-Fi:
adb connect 192.168.1.100:5555 # Replace with your IP- Check the connection:
adb devicesOn Xiaomi TVs, debugging over Wi-Fi can be enabled immediately in the developer settings (Debugging over the network). IP-plug-in.
The advantages of Wi-Fi debugging:
- π No dependency. USB-cable (relevant to TV or tablet).
- πΆ You can control the device remotely (for example, from a laptop in another room).
- β‘ Large files are transferred faster (for example, backups).
β οΈ Warning: When connecting via Wi-Fi, do not disconnect the device from the network - this will interrupt the session ADB. Also make sure that the PC and device are on the same subnet.
Safety when working with ADB: what not to do
ADB It gives you low-level access to the system, so the wrong commands can permanently disable the device:
- π« Run fastboot erase commands without understanding the consequences (e.g., fastboot erase boot will make the device unbootable).
- π« Remove system applications related to MIUI/HyperOS (For example, com.miui.home is a launcher, without it the system will not boot).
- π« Stitching incompatible firmware (for example, firmware for Redmi Note 10 on the POCO X3).
- π« Use adb shell su commands without Magisk or unlocked bootloader (this will lead to an error).
Before the experiments with ADB:
- Create a backup through adb backup or TWRP.
- Check the compatibility of commands with your model in forums (e.g, XDA or 4PDA).
- Use official Xiaomi tools (such as the Mi Flash Tool) for firmware.
If the device stops turning on after commands ADB ("brutes, try it:
- π Get in the Fastboot (Food) + Volume down) and flash the stock firmware through the Mi Flash Tool.
- π οΈ If the bootloader is blocked, contact the service center (independent recovery is impossible).
π‘
Always check the commands for compatibility with your Xiaomi model. For example, commands for Snapdragon processors may not work on devices with Mediatek.