Skip to content

Instantly share code, notes, and snippets.

@TjWallas
Forked from pantasio/enable USB debug.adb
Created September 26, 2021 20:00
Show Gist options
  • Save TjWallas/1a3afdeaa39c0e7b8767331e75a06d7e to your computer and use it in GitHub Desktop.
Save TjWallas/1a3afdeaa39c0e7b8767331e75a06d7e to your computer and use it in GitHub Desktop.
adb cmd enable USB debug cant touch screeen
I got it to work :)
NOTE: This requires unlocked bootloader.
Connect the device to Mac or PC in recovery mode. (I had to map the process in my mind as the screen was broken).
Now open terminal/CMD in computer and go to platform-tools/. type and enter ./adb devices to check if the device is connected in recovery mode.
Now type ./adb shell mount data and ./adb shell mount system to mount the respective directories.
Get the persist.sys.usb.config file in your system using ./adb pull /data/property/persist.sys.usb.config /Your directory
Now open that file in a texteditor and edit it to mtp,adb and save.
Now push the file back in the device; ./adb push /your-directory/persist.sys.usb.config /data/property
Get the build.prop file; ./adb pull /system/build.prop /your-directory
Add these lines:
persist.service.adb.enable=1
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb
Push build.prop back into the device; ./adb push /your-dir/build.prop /system/
This way you enabled USB debugging on your device. But you still can't connect. Why? Because it asks for RSA verification. If you could view your display then you could easily tap on YES to authorize the device. I am currently figuring out to bypass this. I want to revive my dead phone badly. If you know any way to do this, please share :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment