Enable USB Debugging from PC Using ADB Command

Posted by

USB Debugging is an Android developer feature that lets your computer communicate with an Android phone through ADB, or Android Debug Bridge. It is useful when you want to run ADB commands, install APK files from a computer, collect debugging information, transfer certain files, or work with Android development tools.

Usually, you enable USB Debugging directly on the phone through Developer Options. But there are situations where you may want to enable it using an ADB command from a PC.

There is one important catch: ADB normally needs USB Debugging to already be enabled before a physical Android phone will accept ADB commands. So, you cannot use a standard ADB command to magically bypass a disabled USB Debugging setting on a locked, stock Android device.

If your device already accepts ADB commands, however, you can use the ADB shell to change the USB Debugging setting. 

Enable USB Debugging from PC Using ADB Command [Easy Guide]

Enable USB Debugging from PC Using ADB Command
Enable USB Debugging from PC Using ADB Command

To enable USB Debugging using ADB:

  1. First, install ADB Platform Tools on your Windows PC and connect the Android device.
  2. Open Command Prompt or PowerShell in the folder containing adb.exe.
  3. Run adb devices and make sure your Android device appears as an authorized ADB device.
  4. Run the ADB shell command adb shell settings put global adb_enabled 1 to enable the ADB setting.
  5. Check the result with adb shell settings get global adb_enabled.
  6. If the command does not work because the phone is not detected, you must first enable or restore ADB access through the phone, recovery environment, emulator, or another supported method.

The important thing to understand is that ADB is not a backdoor for enabling USB Debugging. A normal Android phone with USB Debugging disabled will generally not establish the ADB connection required to receive an ADB command from your PC.

Therefore, the command in this guide is mainly useful when ADB access is already available, such as on a device where debugging was previously enabled, an Android emulator, or certain development and recovery scenarios.

If you are starting with a completely locked phone where USB Debugging has never been enabled, skip ahead to the troubleshooting information rather than repeatedly trying ADB commands.

Step 1: Download and Set Up ADB Platform Tools

Start by installing Google’s Android SDK Platform Tools on your Windows PC. Platform Tools contains the adb.exe program that allows Windows to communicate with an Android device.

Download the current Platform Tools package from the official Android developer website and extract the ZIP file to an easy-to-find location, such as C:\platform-tools.

After extracting it, open the folder and make sure you can see files such as adb.exe and other Android platform tools. You do not need to install the entire Android Studio package just to use ADB.

For beginners, keeping the Platform Tools folder in a simple location makes the next steps much easier.

Step 2: Connect Your Android Device to the PC

Use a reliable USB data cable to connect your Android phone or tablet to the computer. Some inexpensive cables only provide power and do not support data communication, so Windows may fail to detect the device properly.

Unlock the Android device if possible. If USB Debugging was previously enabled, Android may display an Allow USB debugging? authorization prompt when the computer connects for the first time.

Tap Allow if you trust the computer. You can also select Always allow from this computer if you regularly use the same PC for ADB operations.

Remember that this authorization is an important Android security feature. Do not approve an ADB connection from a computer you do not trust.

Step 3: Open Command Prompt in the Platform Tools Folder

Now open the folder where you extracted Platform Tools.

In Windows 11 or Windows 10, click the folder’s address bar, type cmd, and press Enter. This opens Command Prompt directly inside the Platform Tools directory.

You can also open PowerShell from that location. If you use PowerShell, you may need to enter .\adb instead of simply adb, depending on your PowerShell configuration.

The goal is to make sure Windows can find the ADB executable before you start running commands.

Step 4: Check Whether ADB Can See Your Device

Before changing anything, check the current ADB connection.

Run:

adb devices

Press Enter.

If everything is configured correctly, you should see an output similar to:

List of devices attached

followed by a device identifier and the word device.

That status is important. It means your PC has an active ADB connection and can communicate with the Android device.

If the device appears as unauthorized, look at your phone’s screen for the USB debugging authorization prompt. Unlock the phone and approve the connection.

If nothing appears underneath List of devices attached, ADB does not currently have access to the phone. In that situation, continue with the troubleshooting information later in this guide.

Step 5: Run the ADB Command to Enable USB Debugging

Once your Android device is already accessible through ADB, you can attempt to enable the global ADB setting with the following command:

adb shell settings put global adb_enabled 1

Press Enter after entering the command.

This tells Android’s Settings provider to set the adb_enabled global setting to 1.

On devices and environments where the connected ADB session has sufficient permission, this can enable the ADB debugging setting.

However, Android manufacturers can customize system behavior, permissions, and security restrictions. Because of that, the command is not guaranteed to work on every physical Android phone.

If you receive a permission-related error, do not assume the command syntax is wrong. The Android system may simply prevent the current ADB shell from changing that protected setting.

Step 6: Verify the USB Debugging Setting

After running the command, check the value with:

adb shell settings get global adb_enabled

If the result is:

1

the global ADB setting is enabled.

If you receive 0, the setting remains disabled. If you receive an error, the connected ADB environment may not have permission to read or change the setting.

You can also run:

adb devices

again to confirm that the device is still communicating with the computer.

Keep in mind that changing this setting does not necessarily bypass every security mechanism implemented by the device manufacturer or Android version.

Restart ADB If the Connection Does Not Refresh

Sometimes the ADB connection needs to be restarted after a setting change.

Run:

adb kill-server

Then run:

adb start-server

Finally, check the device again:

adb devices

This restarts the ADB server on your PC and gives Windows another opportunity to establish communication with the Android device.

If the phone appears as a device, the connection is active. If it appears as unauthorized, check the phone for the authorization dialog.

What to Do If USB Debugging Was Completely Disabled

This is the most important part of the guide.

If USB Debugging was completely disabled on a normal, locked Android phone, you generally cannot use ADB from the PC to enable it, because ADB itself depends on debugging access.

In other words, this command:

adb shell settings put global adb_enabled 1

cannot normally be used to establish the first ADB connection when the phone is refusing ADB connections in the first place.

If you can access the phone, the simplest solution is to enable it manually through Settings > About phone > Build number, tap Build number several times until Developer Options are enabled, then go to Settings > System > Developer options > USB debugging and turn it on. The exact menu names can vary by Android version and manufacturer.

If the phone is an Android emulator, you can generally control debugging through the emulator’s configuration and ADB environment without relying on the same physical-device restrictions.

If the device is in a supported recovery or development environment, ADB access may also be available independently of the normal Android interface. However, the commands and permissions available in recovery can differ significantly between devices.

Additional Tips

Use a Proper USB Data Cable

If adb devices does not show your phone, try another USB cable and USB port. A charging-only cable cannot provide the data connection ADB needs.

Keep the Phone Unlocked

On many Android devices, the phone must be unlocked before you can approve an ADB authorization request. Check the phone’s screen whenever you connect it.

Install the Correct USB Driver

Windows may require an appropriate Android USB driver before it can communicate correctly with your phone. If Device Manager shows an unknown Android device or driver problem, installing the manufacturer’s driver may resolve it.

Do Not Treat ADB as a Security Bypass

ADB is designed for debugging and device management, not for bypassing Android’s security model. If USB Debugging was never enabled and the device does not already provide ADB access, there is no universal ADB command that can simply force it on from Windows.

Be Careful With ADB Commands

ADB commands can modify system settings and, depending on the device and permissions available, can cause unexpected behavior. Only run commands you understand, especially when working with system settings.

Faqs

Can I enable USB Debugging on Android using ADB?

Yes, but only when the device already provides an ADB connection with sufficient permissions. You generally cannot use ADB to create the initial ADB connection when USB Debugging is completely disabled.

What is the command to enable ADB debugging?

A commonly used command is adb shell settings put global adb_enabled 1. Whether it works depends on the Android version, device, permissions, and environment.

Why does adb devices show nothing?

This usually means the PC does not have an active ADB connection. Check the USB cable, USB port, Android USB driver, device connection mode, and whether USB Debugging is actually enabled.

What does “unauthorized” mean in ADB?

Unauthorized means the computer has detected the Android device, but Android has not authorized that PC for ADB access. Unlock the phone and accept the USB debugging authorization prompt.

Can I enable USB Debugging without touching my phone?

Not on a typical locked stock Android phone if ADB was already disabled. ADB needs an existing debugging connection, so there is no universal command that bypasses that requirement.

Does USB Debugging damage my phone?

Simply enabling USB Debugging does not normally damage the device. However, it gives a connected computer additional access through ADB, so you should only authorize computers you trust.

Do I need Android Studio for ADB?

No. If you only need ADB, Android SDK Platform Tools is generally enough. Android Studio is a much larger development environment and is not required for basic ADB commands.

Summary

Using ADB to enable USB Debugging can be useful, but there is a key limitation that beginners often overlook. ADB must generally be accessible before an ADB command can change the debugging setting.

Start by installing Platform Tools, connecting the Android device, running adb devices, and confirming that the phone is authorized. If your environment permits changing the setting, run adb shell settings put global adb_enabled 1 and verify the result with adb shell settings get global adb_enabled.

If your phone has USB Debugging completely disabled, however, the ADB command cannot normally be used to establish the first connection. 

In that situation, enable USB Debugging directly from the phone’s Developer Options or use a supported development, emulator, or recovery environment where ADB access is already available.

Leave a Reply

Your email address will not be published. Required fields are marked *