Every Android developer knows and respects the abbreviation ADB. Three simple letters form an acronym for one of the most useful tools available on Android. It’s an integral part of developing apps and creating the new content that we enjoy every day. Without ADB, building the latest hit Twitter client would be that much harder. This is one seriously useful tool that you should absolutely be using for development.
However, the average user can find some clever uses for it as well. ADB is a powerful set of functions that can greatly help power users flash ROMs and manage files. There’s no reason why non-developers shouldn’t take advantage of one really cool function that can greatly streamline moving files around. Here’s what ADB is and why you should try it.
Crossing the bridge
ADB stands for Android Debug Bridge. According to Google’s developer website:
Android Debug Bridge is a versatile command line tool that lets you communicate with an… Android-powered device.
In plain language, ADB is a tool that lets you send commands from the computer to your phone. These commands can do all kinds of useful functions depending on what you’re looking for.
For example, you can use it to copy files between your computer and phone, both ways. It requires typing out path names and lacks a visual interface, but it works.
You can also use it to start a shell, which is like Command Prompt for your phone. A shell can enter all sorts of fun commands that have powerful effects within Android.
For example, in a past article, we showed you how to do a Nandroid backup with a simple shell command. You could use ADB shell to do exactly this.
In addition, ADB is useful for other tools such as QtADB and Holo Backup. QtADB provides a basic point-and-click interface for basic ADB commands. It is incredibly useful and we use it for almost every article for taking screenshots and copying files.
Holo Backup is a neat ADB-based app that can back up all your apps and device data without root access. That’s useful, especially for those who would rather not root or can’t.
How to set up ADB
Go into the settings on your phone and enable Developer options if they aren’t already there. Tap the “Build number” section seven times until you get a popup saying that Developer options are ready.
Go back the general settings and select “Developer options.” Check the box to enable USB debugging. Normally this isn’t a great thing to leave on, as it lets people do exactly what we’re about to do and send powerful commands from an attached PC.
Now you’ll need the Android software development kit. It’s a set of tools for making Android apps, and it’s the only way to get ADB. Google offers it as a free download on their website.
Once you’ve downloaded it and extracted the files to a location of your choice, find them in a browser window and navigate to /sdk/platform-tools. Right click the address bar and select “Copy address.”
Now open the Start menu and type in “cmd”. This will pull up a shortcut to the Windows Command Prompt, which you should open. Type in this command:
Where you replace <directory> by pasting in the address of the Android SDK you copied earlier. Press enter and the Command Prompt will operate from that directory.
Check out the list of commands on Google’s website to see what you can do with a command. Most follow the form:
Where <something> is a flag or command of some kind that tells ADB to do whatever you want. The commands are numerous, but include:
Lists all attached phones in debugging mode
Lists all possible commands
adb install <path-to-apk>
Installs a given app on your phone, where <path> is the full path on your computer to a given .apk file
adb pull <remote> <local>
Copies a given file from your phone to computer
adb push <local> <remote>
Copies a given file from your computer to your phone.
Starts a shell command session on your phone
ADB can be intimidating at first, but it’s a tremendously useful tool. If you’re interested in really digging into Android or just want an easier way to copy files between your phone and computer, ADB can help out.