ADB is a small-size, powerful utility which can do wonderful things for your Android device. All you need to know is the right ADB commands and learn how to use it. There are a number of ADB commands out there, you can browse them directly in your terminal. We’ll discuss it later in this very post but, first let’s know what ADB is.
What is ADB?
ADB (Android Debug Bridge) is a command line utility to control and manage Android devices. It comes bundled with Android SDK but you can download the platform-tools (includes ADB) from Official Android Developer website.
The Important ADB Commands Every Developer OR Advanced User Must Know
Make sure you have the platform-tools before trying out any of the commands. Open Terminal or CMD and point it to the platform-tools directory. You are ready to use ADB tools now.
1. ADB devices
The first and foremost command to list all the devices connected to the computer. Or simply test if an Android device is connected to the computer. Just type
adb devices (Windows) or ./adb devices (MacOS/Linux).
2. ADB pull
It basically pulls files from connected Android devices to the computer, as the name says. You can perform a full phone backup using this single command. Type
adb pull <directory-you-want-to-pull>
e.g. adb pull /sdcard .
3. ADB shell screenrecord
You don’t need a third party app to record a screencast as long as you have a computer. To record a screencast, type
adb shell screenrecord <directory/filename.mp4>
e.g adb shell screenrecord /sdcard/demos/video1.mp4
Note that this doesn’t work in recovery mode like every other command in this article.
4. ADB push
Transfer files or folders from your computer to phone with this simple command. You can transfer APKs, zipped updates, or anything to your phone’s storage. Type the below-mentioned command in CMD or Terminal.
adb push <local> <remote>
e.g. adb push /Documents/update.zip /sdcard/Updates
5. adb connect
Wirelessly connect your device to the computer via WiFi. If you have ADB, you are ready to connect your Android device wirelessly to the computer. The right way to do this:
ii. Now unplug USB cable from your device. Go to Settings > About Phone > Status and make a note of the IP address.
iii. Back to Terminal/CMD, Type adb connect <ip> . And now your device is connected wirelessly. All the commands explained above can be performed wirelessly now.
As written in the first paragraph, You can browse all the ADB commands, right in your terminal. All you need to do is type adb help and press enter. The help information is not so precise, But there’s another website which has good documentation of ADB commands.
So these are the must know ADB commands which you should know when you either debug your device or you want to manage your device without any third party software.