By Lekensteyn


2013-10-24 14:17:30 8 Comments

I am stuck during the boot process, at first before entering the passphrase for /data and now at the SIM PIN screen. At this point, adb is inaccessible (normally adbd would start up after unlocking /data, etc.).

How can I start adbd during boot? This is a CM 10.2 userdebug build for i9300 with /default.prop (from initrd) containing:

ro.adb.secure=1
ro.secure=1
ro.allow.mock.location=0
ro.debuggable=1
persist.sys.usb.config=mtp,adb

I have also tried the following to no avail:

  • Edit /init.rc, comment out the disabled line for service adbd.
  • Edit /init.smdk4x12.usb.rc, add start adbd to the property:sys.usb.config=mtp trigger.
  • Add persist.sys.usb.config=adb to /default.prop

2 comments

@Maahi 2016-02-03 17:34:10

Use this simple one command to get going without stuck!

# setprop persist.sys.usb.config mtp,adb

Awaiting your response!

@Lekensteyn 2016-02-03 19:47:49

This will not work during boot (e.g. before disk encryption is unlocked), though it may become active once Android begins to start.

@Lekensteyn 2013-10-24 16:52:52

Since Android 4.2.2, [USB debugging requires authentication], something that is not possible during boot. To disable this, set the following property in default.prop (inside initrd):

ro.adb.secure=0

Alternatively, copy ~/.android/adbkey.pub into the initial ramdisk of the boot/recovery image at /adb_keys. This preserves the secure feature while granting your key access.

This enables adbd for a short time. It seems that some process is setting sys.usb.config=mtp. To work around that, I applied this patch (perhaps only the start adbd part is necessary, I have only tested the below):

--- init.smdk4x12.usb.rc        2013-10-24 18:47:34.894857300 +0200
+++ init.smdk4x12.usb.rc        2013-10-24 18:47:40.775493943 +0200
@@ -12,10 +12,11 @@
 on property:sys.usb.config=mtp
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 04e8
-    write /sys/class/android_usb/android0/idProduct 685c
-    write /sys/class/android_usb/android0/functions ${sys.usb.config}
+    write /sys/class/android_usb/android0/idProduct 6860
+    write /sys/class/android_usb/android0/functions ${sys.usb.config},adb
     write /sys/class/android_usb/android0/enable 1
-    setprop sys.usb.state ${sys.usb.config}
+    start adbd
+    setprop sys.usb.state ${sys.usb.config},adb

 on property:sys.usb.config=mtp,adb
     write /sys/class/android_usb/android0/enable 0

You won't be able to get root (su) through this. For that, set:

ro.secure=0

Updating the initramfs block, the initramfs header field and the SHA1 ID (header) of the boot.img is not in the scope of this answer.

@phs 2017-11-02 22:14:05

On modern lineage, this is automatically done for you with eng variant builds e.g. brunch lineage_us996-eng.

Related Questions

Sponsored Content

0 Answered Questions

How to enable USB Debugging from recovery mode?

2 Answered Questions

[SOLVED] How to enable adbd to listen to a port at boot time in Android?

2 Answered Questions

[SOLVED] Get into fastboot mode without root or hardware buttons

1 Answered Questions

Added lock screen pin to encrypted device - can't unlock on boot now

0 Answered Questions

Why phone screens have full brightness during boot time?

  • 2016-10-01 13:00:43
  • vijayant
  • 179 View
  • 0 Score
  • 0 Answer
  • Tags:   boot

1 Answered Questions

[SOLVED] Only owner can enable Bluetooth on CyanogenMod

1 Answered Questions

[SOLVED] Boot Loop CyanogenMod

1 Answered Questions

Rooting and run adbd service automatically

0 Answered Questions

CyanogenMod Boot Animation Squished

1 Answered Questions

[SOLVED] MicroSD card performance during boot

Sponsored Content