Enable USB debugging through Clockworkmod with adb

SharkWipf picture SharkWipf · Nov 10, 2012 · Viewed 96.3k times · Source

So, a few days ago my Nexus 7 got dropped, and now there's a big crack in the screen. The touchscreen is broken. That is, I can still see what happens, but it is unresponsive.
I have found a way to completely control it through adb, and through this I rooted it.
However, rooting it wiped all my data and settings, including USB debugging. The result is that I can't control it anymore at all, other than turning it off and changing volume.
Clockworkmod has adb built in. I can fully control CWM from my pc, and access my tablet's files etc.

Now my question is, is it possible to enable USB debugging through Clockworkmod with adb or any other method, and if yes, how?
I do have root access to all files and settings, and I am able to get any needed binary file on it, be it a native Android file, a Cyanogenmod file, any native ARM Linux binary, or something else (think sqlite3 for example).
I also have an adb backup -all -system backup on my pc, but I can't restore it through CWM as far as I can see.
I have access to both Linux and Windows.

Update: I have tried enabling adb in /data/data/com.android.providers.settings/databases/settings.db with sqlite3, but after a reboot the value of adb_enabled was deleted and reinserted at the bottom, with value 0. However some other setting I changed did persist.
I have also tried to modify /init.rc, but this file is also being rewritten on boot it seems.

Answer

Unrealized picture Unrealized · Nov 11, 2012

Well, as far as I know, You can try doing this:

  • Run an ADB shell in ClockworkMod
  • Remount /system in readwrite mode.
  • Add this to /system/build.prop: persist.service.adb.enable=1
  • Save the file.