Can We Enable USB Debugging using ADB Command? – Explanation Guide

USB debugging using ADB command, if you are in a situation where you wish to enable USB debugging and developer options on your Android device, but your screen is cracked or damaged and you cannot unlock it; this article will guide you through doing so.

Please note that we only recommend unlocking android device hardware through ADB commands if absolutely necessary (for example when the phone cannot be unlocked without doing so).

I found that question in the comment posted by one of our users.

USB debugging using ADB command

Though I already knew it wasn’t possible to enable USB debugging with Android Debug Bridge on a Samsung Galaxy S8, for example, I decided to do some research anyway.

Recommended Read

After spending hours on Google trying to find a workaround, I did come across someone claiming they had enabled.

USB debugging through some kind of secret command but we’re hoping it won’t end up as yet another fruitless endeavor because this person’s claim cannot be verified and there’s no proof proving the legitimacy nor the authenticity of their supposed fix.

ADB is an application that lets you interact with your Android device, such as installing apps or removing them. To make ADB commands work, the cellphone must have USB debugging enabled.

If the option isn’t active the commands will not be functional.

Deactivating this option on a broken handset may be necessary to troubleshoot it though users are less prone to finding a way to enable USB debugging using ADB command line.

This guide will teach you the answers to questions like “Do you have to enable USB debugging with ADB” and “How can you ultimately go about enabling USB debugging with ADB”.

Can we Enable USB debugging from PC?

Well, the easy answer to this is that no you could never bypass ADB. USB debugging using ADB command Why? Simply put, ADB requires authorization from an Android device.

In order for ADB to communicate with our Android phone it requires us to let USB Debugging be turned on and we also need to validate the computer’s RSA key fingerprint.

These are security features otherwise anyone who gets a temporary possession of our Android device can manipulate it while we’re away or sleeping.

It’s only when you move the Power switch to the right and hold it until a text appears at the bottom of the screen to choose either Restart or Apply update from ADB.

That your device is detected by the adb daemon regardless of whether or not this option is enabled in your device’s Settings. adb-connected-in-recovery-mode 1

However, if you run the ADB shell commands, you’ll get an error like this in return.

PS C:\> adb shell

error: closed

PS C:\>

If you have a rooted Android device and have TWRP recovery installed on it, there are better chances that you can successfully mount your Android’s system and data partitions using ADB.

Please note that fast boot doesn’t require USB debugging enabled. USB debugging using ADB command You can boot your device into fast boot mode and test.

fastboot devices

fastboot oem unlock

The ‘oem unlock’ command can unlock the bootloader of your phone, but in doing so, it will also perform a factory reset.

Enabling USB Debugging using ADB Command

Reportedly, Pantasio from Github claims that he was able to enable the USB Debugging feature on his Samsung Galaxy Note 10 Plus via Recovery Mode with the help of ADB commands provided by him.

Pantasio later clarified that his method might not have worked for everyone because every person uses a different Galaxy model and also has his own set of preferences when using it.

We’re certain though that for some time now one has been able to access Recovery Mode and disable USB debugging where Developer options are concerned if you’ve unlocked your phone.

Now, let’s move on to the steps necessary to enable USB debugging using ADB commands on devices with a broken or damaged screen.

The method described below will work specifically for Apple devices and may also begin working for Samsung devices if the lead player in your industry continues to improve their quality control.

  1. Boot your Android device into the Recovery Mode.
  2. Download the latest SDK Platform-tools.zip and extract it.
  3. Open the ‘platform-tools‘ folder and launch a command window by clicking on File > Open Windows PowerShell in the folder window. In case you have set up system-wide ADB and Fast boot, you can launch the command window from any screen of your PC.
  4. Anyway, type the following command and press the Enter key.

adb devices

  1. If you get the device ID as an alphanumeric value in the command window, it means that your ADB can detect your device in the Recovery Mode. (Lucky you! :D) I could not get past this step.
  2. Now type adb shell and hit the Enter key. After that, execute the mount data and mount system commands to mount the respective directories on your device.

adb shell

$ mount data

$ mount system

  1. Now, you have to pull the persist.sys.usb.config file from your phone to the PC. To do that execute the following command. Don’t forget to replace the location where you want to save the pulled file with yours.

adb pull /data/property/persist.sys.usb.config C:\Users\Technastic\Desktop\

  1. Open the persist.sys.usb.config file with a text editor and edit it to “mtp,adb” and save it. Now use the adb push command to send it back to your device.

adb push “C:\Users\Technastic\Desktop/persist.sys.usb.config” /data/property

  1. It’s time now to download the build.prop file of your device to your PC.

adb pull /system/build.prop C:\Users\Technastic\Desktop\

  1. Open the build.prop file with a text editor like NotePad++ and add the following lines to it.

persist.service.adb.enable=1

persist.service.debuggable=1

persist.sys.usb.config=mtp,adb

  1. Save the file after you have made the above changes to build.prop and push it back to your phone using the following command.
  2. adb push “C:\Users\Technastic\Desktop/build.prop” /system/

If you followed all the steps carefully, you’ve enabled USB debugging on your device. USB debugging using ADB command You can now reboot your phone back to Android’s system by typing the following command:

adb reboot

Your phone will boot up with USB debugging enabled but there’s a catch!

The security vulnerability gets propagated to the ADB daemon meaning it will have to be in “Secure USB Debugging” mode every time, no matter that you have once allowed it using RSA.

If you are somehow able to see this message, tap on OK. allow-usb-debugging-xiaomi 2

Disable USB Debugging using ADB Command

If your device has a broken or cracked screen and USB debugging is enabled, you can easily disable it. Just use an adb command to do so.

I’ve personally tested this on some devices that have a broken screen, including the Samsung Galaxy Note 10 Plus, Redmi K20 Pro, Galaxy S20 and OnePlus 8.

So long as USB debugging is enabled, this trick should work on all of your Android phones produced by any major manufacturer.

  1. Launch the Command Prompt or open a PowerShell window. You can do that in 3 ways.
  2. Connect your device to the computer and execute the following command after running adb shell.

settings put global adb_enabled 0 disable-usb-debugging-adb-command 3

  1. Now go to Settings > Developers options and you will find that USB debugging has been disabled.

Turn off Developer Options using ADB Command

Turning off the Developer options on Android can be tricky, USB debugging using ADB command especially if you aren’t able to physically access your settings menu.

There are ways around this though. For instance, there is a command that can be issued from your PC as long as you have USB debugging enabled that will disable it:

  1. Open a command window on your computer.
  2. Connect your device to the computer via a USB cable.
  3. Type adb shell, press the Enter key, and then issue the following command to turn off the Developer options on your Android device.

settings put global development_settings_enabled 0 developer-options-adb-commmand 4

  1. As soon as you hit the Enter key on your keyboard, Developer options will be turned off on your Android device.

To check whether you’ve successfully turned off Developer options via ADB, USB debugging using ADB command toggle on the Show notifications option.

Some Android phone and tablet users have reported that they’re unable to enable USB debugging using ADB command.

In fact, we discovered that while the debugging is similar to an “open door” shortcut that allows you to use ADB commands, it actually encompasses a lot more.

That’s why we advise Android developers who want to take advantage of ADB (Android Debug Bridge) tools and make their life simpler when developing apps for Android-based devices like our own original redMi Note.

The Redmi Note 4G which has Mi4i’s best camera, though some in its army might call it the Mi3s.

To turn on Developer options and accordingly enable USB debugging on their Android phone or tablet as you never know when it might come in handy.

Conclusion

If your cell phone is broken, you can use the guide above to access the contents of your device via a black screen. This article may apply if you have a broken screen as well. We hope this article helps you get access to the data stored on your device.

Leave a Comment