To allow USB debugging on an Android device using the command line, you can enable it through the command prompt by executing the following command once your device is connected and recognized by your PC.
adb devices
adb tcpip 5555
adb connect <device_ip>:5555
Replace `<device_ip>` with the actual IP address of your Android device.
Understanding USB Debugging
What is USB Debugging?
USB Debugging is a mode that enables Android devices to communicate with a computer via the Android Debug Bridge (ADB). By turning on USB Debugging, you allow your device to interact with the Android SDK (Software Development Kit), making it crucial for developers looking to test and debug their applications. This functionality is essential for tasks such as installing apps from the computer, running ADB commands, or accessing device logs.
Why Use CMD for USB Debugging?
Using Command Prompt (CMD) to enable USB Debugging can be more efficient than navigating through the graphical user interface on Android devices. It allows quicker execution of commands, batch processing, and troubleshooting issues directly from the PC. CMD is particularly beneficial when working with multiple devices or automating repetitive tasks.

Preparing Your Environment
Enabling Developer Options on Android
To enable USB Debugging, you first need to turn on Developer Options on your Android device. Here’s how you can do it:
- Go to Settings.
- Scroll down and select About Phone.
- Find the Build Number and tap it seven times until you see a message stating, "You are now a developer!".
- Go back to Settings and look for Developer Options.
Within Developer Options, you will also find numerous features that can enhance your Android experience, including options for background processes and animation scaling. Tip: If you encounter issues enabling Developer Options, try restarting your device to ensure the settings take effect.
Setting Up Your Computer
To communicate with your Android device through ADB, ensure that you have the Android SDK Platform-Tools installed:
- Download Android SDK Platform-Tools from the official Android developer website.
- Extract the files to a convenient location on your computer.
Next, verify that ADB is installed properly. Open CMD and run the following command:
adb version
If ADB is installed correctly, you should see the version information. If not, troubleshoot by reinstalling the SDK or checking your environment variables.

Using CMD to Enable USB Debugging
Connecting Your Android Device
Before running any commands, make sure to connect your Android device to your computer using a USB cable. Ensure that the cable supports data transfer, not just charging. Important: Always back up your data before proceeding with the commands to avoid any potential data loss during debugging.
Opening Command Prompt
To execute ADB commands, you'll need to open the Command Prompt. Depending on your Windows version, there are various ways to do this:
- Windows 10/11: Right-click the Start button and select Windows Terminal or Command Prompt.
- Windows 7/8: Press Win + R, type `cmd`, and hit Enter.
Executing the ADB Command
Command to Kill ADB Server
First, ensure that no ADB processes are running by using the following command:
adb kill-server
This command terminates any existing ADB session, allowing you to start fresh.
Command to Start ADB Server
Next, start the ADB server with:
adb start-server
This initializes the ADB daemon, which is necessary for your computer to communicate with the Android device.
Checking Device Connection
To verify that your Android device is connected and recognized, execute:
adb devices
If your device is connected properly, it should appear in the list of attached devices. If you see a "List of devices attached" message without your device listed, double-check your USB connection and ensure that you've set the connection mode to the correct option (such as MTP).
Allowing USB Debugging
Sending the Debugging Permission Command
To programmatically allow USB debugging, execute the following command:
adb shell settings put global adb_enabled 1
Running this command sets USB debugging to enabled on your device, but note that it may not display a prompt for the permissions. Users will, however, need to confirm the "Allow USB Debugging" prompt directly on their device to finalize the debugging access.
Handling the Prompt on Android Device
After executing the command, your device should prompt you to Allow USB Debugging. Confirm this action by pressing OK. If this prompt does not show up, follow the below warning:
Warning: If the “Allow USB Debugging” prompt does not appear, you may need to restart both your device and computer, then reconnect your device.

Common Troubleshooting Issues
Device Not Recognized
If your device isn’t recognized, try the following steps to troubleshoot:
- Make sure USB Debugging is enabled.
- Ensure correct USB driver installation on your PC.
- Switch USB connection types (e.g., from MTP to PTP).
- Try a different USB port or cable.
Permission Not Granted
If the prompt for permission does not show or denies access, check for these reasons:
- Your device might be locked or inactive. Unlock it and try reconnecting.
- Check if Developer Options were reset. You may need to re-enable USB Debugging.
Reconnecting the Device
If you continue facing issues recognizing your device, safely disconnect and reconnect it. Use these commands to reset and check the connection:
adb disconnect
adb connect <YOUR_DEVICE_IP> # If you're using Wi-Fi debugging
Tip: For wired connection issues, sometimes simply switching USB ports or restarting the computer may resolve the problem.

Conclusion
Final Thoughts on Using CMD for USB Debugging
Understanding how to utilize CMD to press OK for allow USB debugging Android through cmd empowers you as a developer or advanced user to customize your Android experience significantly. Familiarity with these commands can optimize your workflow, making testing and debugging smoother.
Call to Action
Feel free to share your experiences or questions regarding the USB Debugging process in the comments section. We encourage you to explore more CMD commands to enhance your productivity with Android development.

Additional Resources
Helpful Links
Refer to the official ADB documentation for more detailed command usage and examples. This will deepen your understanding of the powerful capabilities that CMD commands offer for enhancing your Android development workflow.
Community Support
Join Android development forums or social media groups to connect with fellow developers and get support as you interact with CMD and USB debugging.