Appendix D. ADB: The Android Debug Bridge

In this book, we’ve focused on using an IDE for all your Android needs. But there are times when using a command-line tool can be plain useful, like those times when Android Studio can’t see your Android device but you just know it’s there. In this chapter, we’ll introduce you to the Android Debug Bridge (or adb), a command-line tool you can use to communicate with the emulator or Android devices.

adb: your command-line pal

Every time your development machine needs to talk to an Android device, whether it’s a real device connected with a USB cable, or a virtual device running in an emulator, it does so by using the Android Debug Bridge (adb). The adb is a process that’s controlled by a command that’s also called adb.

The adb command is stored in the platform-tools directory of the Android System Developer’s Kit on your computer. If you add the platform-tools directory to your PATH, you will be able to run adb from the command line.

In a terminal or at a command prompt, you can use it like this:

The adb devices command means “Tell me which Android devices you are connected to.” The adb command works by talking to an adb server process, which runs in the background. The adb server is sometimes called the adb dæmon or adbd. When you enter an adb command ...

Get Head First Android Development, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.