Skip to content

Instantly share code, notes, and snippets.

@AlvaroBrey
Last active March 1, 2019 19:21
Show Gist options
  • Save AlvaroBrey/83d90a6a156790e06b8789447d273ace to your computer and use it in GitHub Desktop.
Save AlvaroBrey/83d90a6a156790e06b8789447d273ace 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
@AlvaroBrey
Copy link
Author

AlvaroBrey commented Nov 21, 2017

@malitech You will need to mount /system through adb shell, but this script executed in your computer.

@calebcabob
Copy link

@ontherunvaro Great stuff dude, thanks!

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