19

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.

SharkWipf
  • 384
  • 1
  • 4
  • 12
  • should post in http://android.stackexchange.com/ – Ling Xing Nov 10 '12 at 22:48
  • I am in a similar situation. How did you manage to control it via adb? – rustyx Jun 21 '13 at 12:32
  • I don't remember exactly how I did it, but I managed to record/send raw input events through adb. I had a friend with the same tablet record the touch events I needed, and played them back through a simple bash script on my own tablet. It wasn't perfect, but it worked. – SharkWipf Jun 22 '13 at 17:02

2 Answers2

21

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.
Unrealized
  • 226
  • 1
  • 2
  • 7
    This works half, but I managed to fix it using this. Android Jellybean apparently gives a nice black screen when adding this line and trying to boot. However, if you **also** set `adb_enabled` to 1 in `/data/data/com.android.providers.settings/databases/settings.db` (the fix I tried earlier), it does work. Thanks! – SharkWipf Nov 11 '12 at 15:52
  • 2
    The answer by @Unrealized doesn't work for me. Change to /system/build.prop prevents my Nexus 7 from booting. Fortunately, the following steps work for me: 1) Unlock the device by "fastboot oem unlock" 2) Download ClockworkMod recovery image 3) Boot the device by Power + Volume Down 4) Run "fastboot flash recovery-clockwork-6.0.3.8-grouper.img" or replace with the img you download in 2) 5) Now you can run adb shell, mount /data, and run "echo 1 > /data/property/recovery-clockwork-6.0.3.8-grouper.img 6) Reboot and you can get debug mode turned on! – vanship82 Oct 01 '13 at 07:00
  • 1
    this doesn't work at all for me using cwm 6.0.4.5, getting error: insufficient permissions for device, another device from the same vendor works just fine but it has usb debugging enabled on the device so no reason to do this – tomasb May 14 '14 at 19:34
  • @SharkWipf - I have tried your solution but does not work on my old Nexus 4 with broken glass. Android 4.4.4 still gives me the black screen. any ideas? – avafab Mar 07 '18 at 23:52
  • 1
    I wouldn’t consider this as an answer. There no instruction, also how does setting adb to enable=1 turn on usb debugging, I thought the question was how to enable usb debugging through adb, this forum isn’t just to help the person asking the question, this is also for people facing the same problem, so a bit of instruction would be of help. Thanks – Michael Oct 10 '19 at 19:04
0

if you can see what happens, what stops you from hooking an USB mouse and clicking the necessary settings with the mouse?

lenik
  • 23,228
  • 4
  • 34
  • 43
  • Well, the fact that I don't have an OTG cable for my tablet, and I do not plan on buying one for a broken tablet which I probably won't have for much longer. Else that'd be the first thing I'd have done. – SharkWipf Nov 11 '12 at 02:05
  • 1
    you may rent a cable for $.50/day + deposit, if it's too expensive to buy. – lenik Nov 11 '12 at 03:16
  • 2
    Not sure about the Nexus 7, but my Nexus 4 phone doesn't support USB mouse interaction with an OTG cable. If you are reading this with the same scenario at hand, I wouldn't waste your time procuring a cable until you confirm or deny that it is supported with your device. Good idea, though. – Evan May 21 '13 at 20:46