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.
- Boot your Android handset into the Recovery Mode.
- Download the latest Android SDK Platform-tools.zip and extract it.
- 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.
- You can then type the following command and then press the Enter key
- 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.
- 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
- 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.
- 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.
“C: \Users\Desktop/persist.sys.usb.config” /data/property
- Now comes the time to download the build.prop file of your Android device to your PC.
adb pull /system/build.prop
- 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
- 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 –
“C: \Users\Desktop/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 –
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.