Installing ADB (Android Debug Bridge)
Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with an Android-powered
device connected to a computer via USB. One of its useful features is the ability to capture a debug log (logcat
).
See: Collect and Share Debug Logs → Step 3.
Download and Install
You don’t need the full Android SDK to use adb. Instead, download the smaller Android Platform Tools which include adb and other essential utilities.
- Go to the Android Platform Tools download page.
- Download the package for your operating system (Windows, macOS, or Linux).
- Extract the contents of the downloaded archive to a location on your computer.
- Run
adb
directly from that folder.
If you plan to use adb often, add the platform-tools
folder to your system PATH so you can run adb
from any terminal or command prompt.
Enable Debugging on Your Device
Before adb can communicate with your Android device, you must enable USB debugging:
- On your device, go to Settings → About phone.
- Tap Build number seven times to enable Developer options. You may need to enter your device PIN or password to confirm.
- Go back to Settings and select System (or directly Developer options on some devices).
- Enable USB debugging.
For more detailed instructions, refer to the official guide.
Connect Your Device
- Connect your Android device to your computer via USB.
- The first time you connect, unlock your device and accept the RSA key prompt to authorize the connection.
- You may choose to always allow connections from this computer.
Windows
You may need to install a USB driver for your device if it’s not recognized, see the OEM USB Drivers page for instructions.
Linux
You may need to add a udev rules file. See here for details.
Verify Connection
Run the following from inside the platform-tools
folder (or anywhere, if adb is in your PATH):
adb devices
If connected, you should see your device listed under List of devices attached.
- If the device is listed as unauthorized, check your device for the RSA prompt and accept it.
- If the device is listed as offline:
- Try killing the adb server with
adb kill-server
- Disable and enable USB debugging on the device.
- Start the adb server again with
adb start-server
d - Reconnect the device and check
adb devices
again.
When Finished
When you’re done using adb, you can simply disconnect your device. If you want to stop the adb server, run:
adb kill-server