Recently a short fall broke not only my Nexus 4's cheap phone case, but the digitizer as well. The LCD and everything else is perfect, however the touch screen only works on the top quarter of the screen. I have no bluetooth mouse/keyboard and USB On-The-Go doesn't work for Nexus 4.

Unfortunately USB Debugging is disabled (I really regret turning it off). How can I unlock it or back up the data on my phone?

  • 1
    Thanks for the help! That's exactly what I was looking for. However I managed to fix it a very unorthodox way. The pattern unlock would only register the top row of dots, but if I put water on the screen, occasionally the other half would flicker a touch response. After several painstaking hours of swiping in my needlessly complicated password onto a wet screen, it unlocked, and I was able to enable USB debugging.
    – LucasR123
    Sep 9 '14 at 20:51
  • Wow. I wouldn't suggest anyone to "put water on the device" for troubleshooting – as that usually rather results in the trouble shooting you #D Next time, try contact spray instead #D
    – Izzy
    Sep 10 '14 at 13:19

This is word for word from http://forum.xda-developers.com/nexus-4/help/broken-digitizer-to-enable-usb-t2206706/page2 response from Dabyd64. I copied this in its entirety for reference and to have this on the Stack Exchange.

"I finally get it working by installing CWM recovery, which has ADB, and enable the adb debugging.

adb shell
mount -a

(if the following two commands show error "file doesn't exist", don't worry, it's ok!)

rm /data/property/persist.service.adb.enable
rm /data/property/persist.sys.usb.config

echo "persist.service.adb.enable=1" >>/system/build.prop
echo "persist.service.debuggable=1" >>/system/build.prop
echo "persist.sys.usb.config=mass_storage,adb" >>/system/build.prop"
/system/xbin/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global set value='1' where name='adb_enabled'";
/system/xbin/sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global set value='1' where name='development_settings_enabled'";

If the sqlite3 command shows error (command not found) then your phone doesn't have sqlite3 installed. Still, you can do it! First extract settings.db:

adb pull /data/data/com.android.providers.settings/databases/settings.db

Copy that file to a usb drive or whatever. Now you need linux. It's ok to use a live Ubuntu DVD, but you need to be connected to internet. http://www.ubuntu.com/download/desktop I recommend to use the 32bit version for compatibility. Usually sqlite3 is not installed by default.

In ubuntu:

sudo apt-get install sqlite3

You will be asked for the root password!

Now we can edit the settings.db:

sudo sqlite3 /path_to_your_folder/settings.db
update global set value='1' where name='adb_enabled';
update global set value='1' where name='development_settings_enabled';

Now we have the settings.db changed and ready! Copy that settings.db again to a pen drive or whatever, go back to windows or keep in linux if you already have a working ADB.

adb push settings.db /data/data/com.android.providers.settings/databases/
adb shell "chown system.system /data/data/com.android.providers.settings/databases/settings.db"
adb shell "chmod 644 /data/data/com.android.providers.settings/databases/settings.db"

Done! ADB should work when in starts. I had to use "mass_storage,adb" because "mtp,adb" or just "adb" didn't work. Thought, the phone was not working in mass storage, but who cares! ADB was!"

I have used those on my Nexus 7 when I broke my digitizer and adb was turned off. It worked perfectly, should work just as well with TWRP.

Not the answer you're looking for? Browse other questions tagged or ask your own question.