How to enable USB debugging using ADB Command

If you’re looking to enable USB Debugging using ADB commands, then you must be in a desperate situation. If you’re in a situation where the only way of saving your device is using ADB commands, then this article will be of great help to you.

So now comes the question, is it possible to enable USB debugging using ADB commands? Yes, it is possible to enable USB Debugging using ADB Commands, but it’ll only work on Android devices and it must have the bootloader unlocked.

Enable USB Debugging using ADB Commands on your Android device

Now comes the time to know how to enable USB Debugging using ADB Commands on devices that have broken or damaged screens. The method mentioned here will work on Android devices as long as they have an unlocked bootloader.

enable USB debugging using ADB Command

  1. Boot your Android handset into the Recovery Mode.
  2. Download the latest Android SDK Platform-tools.zip and extract it.
  3. Open the Platform-Tools folder and then launch a command window. It can be launched by clicking on File -> Open Window PowerShell in the folder window. If you have set up system-wide ADB, you can simply launch the command window from any screen on your desktop.
  4. You can then type the following command and then press the Enter key
adb devices
  1. If you get the device ID as the alphanumeric value in the command window, then it’ll mean that your ADB can detect your Android smartphone in the Recovery Mode.
  2. Type adb shell and then hit the Enter key. Once it is done, execute mount data and mount system commands for mounting the respective directories on your Android device.
adb shell

$ mount data

$ mount system
  1. Now, you will have to pull the persist.sys.usb.config file from your device to your PC. For doing that, you should execute the following command. You shouldn’t forget to replace the location where you’re entering to save the pulled file with yours.

adb pull

/data/property/persist.sys.usb.config

C: UsersDesktop

  1. Now, open the persist.sys.usb.config file by using a text editor and then edit it to “mtp.adb” and save it. Use the adb push command for sending it back to your Android device.
adb push

“C: UsersDesktop/persist.sys.usb.config” /data/property

  1. Now comes the time to download the build.prop file of your Android device to your PC.
adb pull /system/build.prop

C: UsersDesktop

  1. After that, open the build.prop file using a text editor and then add the following lines –

persist.service.adb.enable = 1

persist.service.debuggable = 1

persist.sys.usb.config = mtp,adb

  1. Lastly, save the file after you’ve made the changes to build.prop and then push it back to your Android device using the following command –
adb push

“C: UsersDesktop/build.prop” /system/

If you’ve followed all the steps properly, then USB Debugging will be enabled on your Android device. You can now reboot your smartphone to the system by giving the following command –

adb reboot

Your Android will boot up with USB Debugging enabled, however, there is a catch. Next time, when you’re trying to run ADB Commands, you will still need to allow USB Debugging or verify the RFA key fingerprint on your Android device. If you’re able to see the RCA notification on your device, simply tap on OK.

Liked this post? Let us know on X (formerly Twitter) - we love your feedback! You can also follow us on Google News, and Telegram for more updates.

Aviral Sharma
Aviral Sharma
Aviral Sharma is a talented and passionate writer who has been using words to express his thoughts ever since he learnt how to hold a pen. He is passionate about outer space, history, sports and most importantly technology. Aviral is a regular writer for rootmygalaxy.net and has been getting better by the day. He currently own Samsung Galaxy S24 Ultra, iPhone 13 and a HP Pavilion laptop

Leave a Comment