What is ADB? (Also: How to record your Android’s screen)

So earlier this week I found myself reading an article on how to record an Android device’s screen without having to root. The process involved using the ADB tool. As quoted by Google,  ‘[the ADB tool is,] a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device.’ So essentially, you can tell your Android to do stuff via the command line on your PC.

But the one thing that grabbed my attention was the possibility of recording the screen of my device, as there are no other ways to do this without rooting, which I wanted to avoid for the time being. The process is pretty simple:

Setting Up

1. Download the Android SDK from Google and get it all set up.

2. Locate the ‘sdk’ folder. You’ll find it where you told the Android SDK to install.

3. Inside that, open the ‘platform tools’ folder.

4. Hold shift and right click the ‘adb.exe’ file

5. Click ‘Open the command window here’.

6. Now plug in your device, making sure you have enabled ‘USB Debugging’

7. To check that your device is connected properly, type:

adb devices

into the command window.

8. If an item named ‘device’ pops up, everything’s going well.

9. Now you have control over your Android device.

Commands

There are four commands which I think are particularly useful: push, pull, screenrecord, and install.

Push

The push command basically lets you transfer files from your computer to your device. Essentially, it pushes them over. This can be useful for transferring files without having to use a third-party app. The only downside is that you have to type in the exact filepath of the document you want to transfer, and the location of the final location on your phone. Here’s an example:

adb push C:/Users/Ben/Downloads/music.mp3 /sdcard/music.mp3

In this example, I am pushing a song in my Downloads folder to the storage on my phone. Note: Pushing a file actually copies the file over, so you still have an original copy on your computer once the process has finished.

Pull

The pull command does exactly the opposite of the push command. Insteaad of copying files from your computer to your phone, it copies them from your your phone to your computer. This can be very useful if you’ve just used he command below…

Screenrecord

The screenrecord command is slightly more complicated as there are a few variables you have to specify before recording. Namely, ‘bit-rate’ and ‘time-limit’. By default, these are set to 4MBps and 3 minutes respectively. I found that upping the bit-rate to 16MBps made the video quality more watchable. Here’s and example of the ‘screenrecord’ command:

adb shell screenrecord --bit-rate 16000000 --time-limit 60 /sdcard/recording.mp4

THe command above will record a 16MBps video for a minute and save it as a .mp4 called ‘recording’ in the phone’s storage. Here’s the video I recorded:

Install

Finally we have my favourite command. Install. This allows you to directly install .apk files from your computer onto your phone, hassle-free. I found it’s particularly useful when sideloading apps, as you can donwload them to the PC and also scan them for viruses. Here’s what it would look like:

adb install C:/Users/Ben/Downloads/game.apk

Simple as that.

Share on FacebookTweet about this on TwitterShare on Google+Share on Reddit