Android Remote Control through ADB

Today, I stumbled on perhaps the most ingenious use of ADB ever:

Remote control your Android phone through adb

A program and write-up by Marian Schedenig, that they shared on their website. This is perhaps the best adb tool I have ever seen, in that it takes three simple principles and puts them together to allow you to remote control your phone over ADB with your mouse, without ROOT permission!


Here is a small gif that I put together from a screen recording of me using this awesome java tool. Essentially, it uses adb to take screen shots of the phone. Then it downloads the screen shot and updates it’s display. Finally, when you click on the screen, it sends an x/y co-ordinate to the phone over adb to tell it you swiped or clicked! It is absolutely brilliant!

The updates are a little slow, and you do have to edit the config file for your specific needs, but it works great, and is a really useful tool if you broke your screen or have touch screen issues, or just need to display your screen for an audience to view while you press buttons or work with apps. Since it is written in java, it is cross platform as well!

Linux – keep it simple.


Taking a screen shot of an Android phone while it is still booting.

I stumbled upon an interesting tidbit the other day. I was trying to take a screenshot of my Android phone while it was playing the boot animation. Of course I tried the standard adb tools:

adb shell screencap -p /sdcard/screencap.png

To which I would follow with an adb pull to get the file. However, since this was during an Oreo bring-up, Some things still were not right, and it couldn’t create the screenshot due to not finding the /sdcard. So I Googled a bit, and found this command:

adb shell screencap -p | sed ‘s|\r$||’ > screenshot.png

Which gave me a file, but it was corrupt and wouldn’t work. Further tinkering and searching, I found that it needed to take care of two carraige returns, like so:

adb shell screencap -p | sed ‘s|\r\r$||’ > screenshot.png

And voila! Now it works!


Linux – keep it simple.