How to Include and Use ADB On Xiaomi devices: the complete guide

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.

πŸ“Š What do you plan to use for? ADB Xiaomi?
Unlocking the loader
Removal of embedded applications
Recovery after failure
Installation of custom firmware
Other

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:

  1. Open the Settings. β†’ About the phone (or About the tablet / About TV).
  2. Find the item Version. MIUI (or HyperOS version) and tap it 7 times in a row until the notification β€œYou became a developer” appears!".
  3. Return to the main settings menu – there will be a new section for developers (or additionally). β†’ Developer settings on HyperOS).
  4. Turn on the debugging switch. USB Confirm the action in the dialog window.
  5. 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

Done: 0 / 5

Installation ADB on the computer: drivers and tools

To work with ADB PC-should be required:

  1. Install drivers for your Xiaomi device (unless Windows recognizes them automatically).
  2. Download the Android platform SDK Platform-Tools (the official Google package, including adb.exe and fastboot.exe).
  3. 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 devices

If 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.DescriptionExample of use
adb devicesShows a list of connected devicesadb devices -l (supplementary)
adb shellOpens the shell of the device to execute commandsadb shell ls /system/app (viewing of system applications)
adb installSet up APK-fileadb install app.apk
adb uninstallRemove the application by batch nameadb uninstall com.miui.weather (remove the weather) MIUI)
adb pullCopies a file from a device to a PCadb 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 settings

How to return a remote system application?
If you have removed the application through ADB If you want to restore it, you can: 1. perform a reset (but this will delete all data). 2. Refuse the device via the Mi Flash Tool (requires an unlocked bootloader). 3. Restore from a backup if it was created through adb backup.

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:

  1. Connect your device to your Mi Account in settings (Accounts) β†’ Mi Account).
  2. Go to the site. https://en.miui.com/unlock/ Download the Mi Unlock Tool.
  3. 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).
  4. 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 unauthorizedNo permission is given to debug on the deviceDisconnect / connect the cable and confirm the request on the smartphone screen
no devices/emulators foundDrivers are not installed or the cable is faultyCheck the connection, install the drivers manually
adbd cannot run as rootADB rootlessUnlock the bootloader and flash Magisk for root
protocol fault (no status)Conflict of versions ADBUpdate 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 reboot

Xiaomi 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:

  1. Connect the device to the PC by USB and do it:
adb tcpip 5555
  1. Turn off the cable and find it. IP-device address in Wi-Fi settings.
  2. Connect to Wi-Fi:
adb connect 192.168.1.100:5555 # Replace with your IP
  1. Check the connection:
adb devices

On 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:

  1. Create a backup through adb backup or TWRP.
  2. Check the compatibility of commands with your model in forums (e.g, XDA or 4PDA).
  3. 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.

FAQ: Frequent questions about ADB on Xiaomi

Can I include? ADB lock-down?
Yeah, debugging. USB It works on a locked bootloader, but with limitations. You can't run root-right commands or flash system partitions.
Why can’t ADB see my Xiaomi device?
The reasons may be as follows: πŸ”Œ Faulty. USB-cable or port (try another cable). πŸ–₯️ No drivers installed (check in Device Manager). πŸ“± Not included debugging USB or not given permission for PC. πŸ”„ Device in Charging Mode (try selecting File Transfer when connected).
How to turn off ADB, if the device does not respond?
After the teams ADB It's stuck: Press the power button for 10 to 15 seconds to force a reboot. If it doesn't work, remove the battery (on removable batteries) or wait for it to run out. For TV, disconnect for 1 minute, then turn it on again.
Does it work? ADB Xiaomi with HyperOS?
In HyperOS, Xiaomi tightened control over system commands: 🚫 Blocked removal of some system applications. πŸ”’ Adb shell su commands require Magisk even after unlocking the bootloader. πŸ“± Some functions (such as adb backup) may not work well, and full access will require unlocking the bootloader and installing Magisk.
Can we do this? ADB unlock?
Theoretically, yes, but it requires an unlocked bootloader and access to the data partition. Without that, you can only delete the pattern lock through a fastboot erase userdata, which will delete all the data. On a locked bootloader, unlock the screen through a lockdown. ADB impossible.