Skip to content

Instantly share code, notes, and snippets.

@calebcabob
Forked from AlvaroBrey/authorize_adb.sh
Created January 12, 2019 04:24
Show Gist options
  • Save calebcabob/eb4ebfbde206e5a543862a4fa77f915a to your computer and use it in GitHub Desktop.
Save calebcabob/eb4ebfbde206e5a543862a4fa77f915a to your computer and use it in GitHub Desktop.
Authorize ADB for a non-booting device
#!/usr/bin/env bash
adb shell 'echo "persist.service.adb.enable=1" >> default.prop'
adb shell 'echo "persist.service.debuggable=1" >> default.prop'
adb shell 'echo "persist.sys.usb.config=mtp,adb" >> default.prop'
adb shell 'echo "persist.service.adb.enable=1" >> /system/build.prop'
adb shell 'echo "persist.service.debuggable=1" >> /system/build.prop'
adb shell 'echo "persist.sys.usb.config=mtp,adb" >> /system/build.prop'
adb push ~/.android/adbkey.pub /data/misc/adb/adb_keys
@calebcabob
Copy link
Author

  1. Reboot to TWRP
  2. Mount /system
  3. Execute this script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment