Introduction / Why This Is Needed
USB debugging is an Android function that opens a direct communication channel between the device and a computer via the ADB (Android Debug Bridge) protocol. With it, you can:
- Install applications directly (
adb install). - Retrieve system logs (
adb logcat) for error analysis. - Execute commands in the device shell (
adb shell). - Take screenshots and record screen video.
- Flash custom ROMs and gain root access.
⚠️ Important: Enabling USB debugging reduces security. When connected to an unknown computer, a malicious actor could access your data. Always disable the option after use and only permit debugging on trusted computers.
Requirements / Preparation
Before you begin, make sure you have:
- An Android device running version 4.2 or newer (in older versions, Developer Options are available by default).
- A USB cable that supports data transfer (not just charging).
- A computer (optional, if you are verifying the connection).
- ADB tools installed on your computer (download SDK Platform Tools from Google).
- Activated Developer Options (instructions below).
Step-by-Step Guide
Step 1: Activate Developer Options
By default, Developer Options are hidden. To activate them:
- Open Settings → About phone (or System → About device).
- Find the Build Number entry.
- Tap it 7 times in a row. A notification will appear: "You are now a developer!".
- Return to the main settings menu — a new entry called Developer Options will appear.
💡 Tip: On some firmware (e.g., MIUI), the "Developer Options" item may be located under Additional settings → Developer options.
Step 2: Enable USB Debugging
- Go to Settings → Developer Options.
- Find the USB Debugging toggle and enable it.
- A warning about risks will appear — tap OK.
If the toggle is unavailable (grayed out), first enable Developer Options (see Step 1).
Step 3: Connect to Computer and Authorize
- Connect the device to the computer using a USB cable.
- A dialog window "Allow USB debugging?" will automatically appear on the phone.
- Tap Allow (or Always allow from this computer to avoid the prompt in the future).
- If the window does not appear:
- Check the USB connection type: pull down the notification shade and select "Transfer files (MTP)" or "USB for Android" (PTP).
- Reconnect the cable.
- Reboot the device.
Step 4: Verify Functionality (Optional)
To ensure debugging is working:
- Install ADB on your computer.
- Open a terminal (Linux/macOS) or command prompt (Windows).
- Run the command:
adb devices - In the output, you will see your device's serial number with the status device:
List of devices attached 1234567890ABCDEF device
If the device is not listed, see the "Troubleshooting" section.
Verification
After completing the steps, you can confirm success in several ways:
- In Android settings:
Go to Settings → Developer Options — the USB Debugging toggle should be enabled. - When connecting to a computer:
Upon connecting to a new computer, an authorization request will appear on the device. After confirming, the status inadb deviceswill change todevice. - Via ADB commands:
Try running a simple command, for example:
This will return the Android version on your device.adb shell getprop ro.build.version.release
Troubleshooting
The USB Debugging option is unavailable (gray toggle)
- Cause: Developer Options are not activated.
- Solution: Repeat Step 1 (tap "Build Number" 7 times).
The authorization prompt does not appear
- Cause: Incorrect USB connection type, faulty cable, or missing drivers.
- Solution:
- Change the connection type to Transfer files (MTP).
- Try a different USB port or cable (ensure the cable supports data transfer).
- On Windows, install ADB drivers (sometimes device-specific drivers from the manufacturer are required).
ADB does not see the device (adb devices is empty or shows unauthorized)
- Cause: The computer is not authorized or the ADB server is not running.
- Solution:
- Reconnect the device and confirm the authorization prompt on the phone screen.
- Run:
adb kill-server adb start-server adb devices - On Windows: Open Device Manager and update the drivers for the connected phone (select "Android ADB Interface").
The device does not charge while debugging is enabled
- Cause: There is no link between debugging and charging. The issue is likely with the cable or port.
- Solution: Use a cable capable of both charging and data transfer. Check the computer's USB port.
The phone runs slower after enabling USB debugging
- Cause: Some firmware (e.g., MIUI) may limit performance when Developer Options are active.
- Solution: Disable USB debugging when not needed. This will not affect basic functionality.
Done! You can now use ADB for development, data backup, or app installation. Remember to disable USB debugging after finishing your work to maintain security.