Introduction: Using Cerberus to Enable ADB Android Debugging on Phone With Cracked Screen

I dropped my Nexus 4 on New Year’s Eve and the screen cracked. I still could see the images but the digitizer stopped working, so the only thing I could do was connect it to the computer and backup the folders I had access to. I was interested in backing up a few settings from some apps so that I didn’t have to configure everything again on my next phone.

I found a program that was able to control the cellphone with gestures, Ultimate Touch Gestures, just connecting it to the computer, but it required Android Debugging to be enabled.

My Nexus 4 was running Cyanogen Mod, was rooted, but had Android Debugging disabled.

I had installed Cerberus on my cellphone and I found out that it lets you send commands to the phone using adb shell. The tricky part was that I wanted to turn on a setting that is well hidden into Android’s configs, so I didn’t have the skills and knowledge to enable it through command line.

My solution to this problem was to send key inputs to the cellphone using the command window. It is painfully slow, but it works very well and I was able to enable Android Debugging and use ADB to use the Ultimate Touch Gestures.

Tools I used:

Cerberus Anti-Theft

Nexus Root Toolkit

Ultimate Touchscreen

USB cable

PC running Windows 7

Cellphone used:

Nexus 4 with cracked screen – running Cyanogen Mod 11 (4.4.4)

Step 1: Connecting to Cerberus

Open the Cerberusapp website on your browser and login to your account.

On the top left you’ll choose the cellphone you want to control (if you have more than one) and the command you want to use. You will choose the command “Start shell” and press “Send command”.

Once the screen shows that the command has been executed, click on “Launch shell”.

Now you should see a black command screen, that's where you input commands to control the cell phone.

Step 2: Sending Commands and Enabling ABD Android Debugging

Using Cerberus shell you’re able to send a lot of commands to your cellphone. You can find a lot of information on that on the internet, and a lot of people that know how to use it properly.

The first thing you want is to start the adb shell, so type:

adb shell

and press enter.

You’ll have to be a superuser, so type:

su

and press enter.

Now you can input the keypresses to your cellphone. There is a list (adb shell input events.txt) attached with all the keys that can be pressed and the number of each one. The syntax of the command to press a key is “input keyevent ##” where ## is the number of the key you want to press.

The following commands were used to unlock my phone (I use a 4 digit PIN-1234):

You have to press enter for each line.

input keyevent 26

input keyevent 8

input keyevent 9

input keyevent 10

input keyevent 11

That sequence corresponds to:

Power button , 1, 2, 3, 4

You may need to input the key “Enter” after the last digit:

input keyevent 66

This brought me to the homescreen. I need to get to the settings. The easiest way to do that is through the “Menu” button input and arrow keys + enter. I did it using:

input keyevent 82

input keyevent 20

input keyevent 20

input keyevent 20

input keyevent 66

Using the same principles shown before, you should be able to navigate every item on the settings menu. Go to the Developer Options, sending “Keypad_Dpad_Down” commands (input keyevent 20) then enable Android Debugging ADB.

Step 3: Connect Your Phone to the Computer

You’re going to have to install the android drivers in your computer. There are many ways to do that, but I chose to use the Nexus Root Toolkit, followed the instructions for drivers installation and everything worked flawlessly. For other brands of cellphones, there are other guides on the internet on how to do that.

Step 4: Controlling Your Phone, Using Gestures, From the Computer

You have to download the Ultimate Touchscreen Control for Android

After you download and open the program (it’ll probably crash on the first time, just close and open again) you’ll have to point to the directory where it can find the file “adb.exe”. The Nexus Root Toolkit installed it for me, so I’ll just get it from its folder. It should be something similar to this: “C:\Program Files (x86)\WugFresh Development\data\adb.exe”

You might need to click “Restart ADB” for it to work. Your device will appear listed. If it doesn’t appear, probably the adb enabling was unsuccessful, you might have to reinstall the drivers or turn on and off MTP on the storage settings on your phone.

Resize the screen window (using the magnifying glass) so that it fits on your monitor and open the gestures screen (through the shortcut on the keyboard).

In order to successfully use the gestures window you have to choose the correct resolution of your phone and resize the transparent screen by dragging the window borders until the transparent area is the same size of the main phone screen.

Now you can control your phone using gestures and mouse clicks.

Step 5: References

Thank you for your attention, I hope this was helpful. If you have comments or suggestions, please comment and I'll do my best to improve this tutorial and try to help you.

Most of the information shown here I got from the following pages:

http://forum.xda-developers.com/showthread.php?t=2...

http://stackoverflow.com/questions/13326806/enable...

http://stackoverflow.com/questions/7789826/adb-she...

http://www.reddit.com/r/Android/comments/1r2zha/

http://blog.softteco.com/2011/03/android-low-level...

http://www.wugfresh.com/nrt/

Thanks!