GUIDE: Data Recovery with a Broken Screen/Digitizer
This weekend I made the unfortunate mistake of breaking the glass on my Nexus 4 - the LCD worked fine but I couldnt tap or type anything. This posed a problem to get some of my data off the phone prior to wiping it. Eventually I found a way to control the phone using adb and an app called mymobiler so I wanted to write a guide in hopes this may ease the pain for someone in the future.
Step 1: Gain root access to your Nexus. You will need to install adb and run adb shell. If you can run adb shell successfully you are ready to go. There are plenty of guides about how to do this so I wont repeat the process here.
Step 2 (Optional): In my case I had recently reimaged my PC and so it was no longer an authorized device. When running adb shell I got the popup on my screen to authorize my PC, but of course I couldn't click "Accept". So I had to find a workaround:
2a: First you need your adbpub.key file. It should be in %HOMEPATH%/.android on Windows. You might need to run adb once to generate the file.
2b: Reboot into recovery. I used Clock Work Mod (non-touchscreen) 126.96.36.199. The non-touchscreen version is important because you need to use your volume keys and power button to navigate around CWM. Source: CWM
2c: Make sure you use the Google ADB drivers - I found them here: XDA-Dev's drivers
2d: In CWM, Go to mounts and mount /data
2e: Now on your PC connect your USB cable. Run these commands:
adb push adbkey.pub adbkey.pub
cat adbkey.pub >> /data/misc/adb/adb_keys
2f: In CWM, go back to Mounts and Unmount /data
2g: Run adb reboot or reboot in CWM to go back to the Android OS.
2h: Now once its back in the OS, you should be able to run adb shell and your PC will already be authorized!
Step 3: Go to apk downloader (http://apps.evozi.com/apk-downloader
) and get the MyMobiler apk
Step 4: Run "adb install com.mymobiler.android.apk"
Step 5: Now you'll have to have fun hunting and pecking around with adb shell input touchscreen tap <x> <y> commands. The x and y are coordinates starting at the top left. So on the Nexus 4 the screen res is 768x1280. The top left corner is 0, 0 - the bottom right is 768, 1280. The center of the screen is 384, 640. There is also a whole list of keys that can be pressed with the adb shell input keyevent <code>, a list of codes is here: ADB KEYs
. You will need to peck around to get the MyMobiler app started up.
Step 6: Install and run the MyMobiler PC client available on their website (http://www.mymobiler.com
Step 7: MyMobiler needs you to set the options>display>other on the Android, you will probably get a black screen if you dont set this (I did). Again you will have to play around with simulating the taps using the above info.
Step 8: Once MyMobiler is working right, you can use your PC keyboard and mouse to control your screen, backup your important stuff, and wipe your data before putting it up on eBay (or in the trashcan).
Hope this helps someone stuck in this precarious position.