What Is ADB? The Tool Every Android Developer Should Know (Client, Server, adbd) #Shorts #coding
What is ADB? The tool every Android developer should know. ADB (Android Debug Bridge) is a command-line tool that lets your computer talk to an Android device. Here is what you can do with it, and how its three parts work: the client, the server and the adbd daemon.
WHAT YOU NEED
- A computer (no phone needed to follow this one)
- Curiosity about how adb install, adb logcat and adb shell reach your phone
STEPS With ADB you can install apps, read logs and open a shell on your phone. The client is the adb command you type in a terminal. The server is a background process on your computer. It manages communication between the client and the daemon. The daemon, adbd, is a background process on the phone. It runs the commands. The server starts by itself the first time you run an adb command, and listens on local TCP port 5037. When you run adb install, the client asks the server, the server passes the command to the phone, and adbd runs it.
COMMANDS FROM THE VIDEO
adb devices
adb install app.apk
adb logcat
adb shell
GOOD TO KNOW
- Next step: install ADB on your computer (see the next video in the series).
- ADB needs the phone connected with USB debugging on, or paired over Wi-Fi on Android 11 and newer.
FAQ
What does ADB stand for?
Android Debug Bridge. It's a command-line tool that lets your computer talk to an Android device: install apps, read logs and open a shell.
What are the three parts of ADB?
A client (the adb command you type), a server (a background process on your computer that manages communication) and a daemon called adbd (a background process on each device that runs the commands).
Which port does the ADB server use?
The server binds to local TCP port 5037 and listens for commands from adb clients. It starts by itself the first time you run an adb command.
What does adb devices print?
A list with each device's serial number and its state. The states are device (connected), offline (not connected or not responding) and no device (nothing connected).
Do I need Android Studio to use ADB?
No. SDK Platform Tools alone include adb. Android Studio also includes Platform Tools and keeps them updated.
Where do I download ADB?
SDK Platform Tools is a free download on the official Android developer site (zip files for Windows, Mac and Linux): https://developer.android.com/tools/releases/platform-tools
Can ADB debug my users' phones?
Only phones connected to your computer. For bugs on users' devices, the app has to send its logs somewhere you can read them, which is what a remote logger such as Bugfender does.
What is Logcat?
Android's system log. Run adb logcat to print every log on the phone: system services, other apps and yours.
What does adb kill-server do?
It stops the ADB server. The next adb command starts a new one, which fixes most offline and not responding states.
How do I turn on Developer options?
Open Settings, About phone and tap Build number seven times. On Android 4.2 and higher the Developer options screen is hidden until you do this.
Why does my terminal say adb: command not found?
The platform-tools folder isn't on your PATH. Add it to your PATH, or open a terminal inside the folder and run./adb on Mac and Linux (adb on Windows Command Prompt).
What does unauthorized mean?
The phone hasn't approved this computer yet. Unlock the phone and accept the Allow USB debugging prompt. No prompt? Tap Revoke USB debugging authorizations in Developer options and plug the phone in again.
What does offline mean in adb devices?
The device is not connected to adb or is not responding. Try another cable, then run adb kill-server. The next adb command starts a fresh server.
ABOUT THIS VIDEO
The terminal lines are a real adb session. The computer and phone drawings illustrate the idea, and the animated bug is the Bugfender logo. The narration is an AI voice.
ADB works for phones you can plug in. When the bug happens on a user's phone, there is no cable and no Logcat. Bugfender collects your app's logs remotely from the devices where the bug happened, with the device and app version next to each line. It works next to ADB, it doesn't replace it. Get started for free: https://bugfender.com
RELATED VIDEOS
"How to Install ADB on Mac and Windows"
"How to Set Up ADB on Your Android Phone"
LINKS
Android Debug Bridge (official docs): https://developer.android.com/tools/adb
SDK Platform Tools download: https://developer.android.com/tools/releases/platform-tools
Developer options and USB debugging: https://developer.android.com/studio/debug/dev-options
Logcat command-line reference: https://developer.android.com/tools/logcat
ADB debugging guide (Bugfender blog): https://bugfender.com/blog/adb-debugging/
Bugfender: https://bugfender.com
#Shorts #AndroidDev #ADB