-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Installing adb
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).
Normally, adb is made available by installing the much larger Android SDK. But installing the entire SDK is overkill when all that is needed is adb. The Android Platform Tools contain a subset of the tools, including adb.
Unpack the tools and run adb directly from the folder you've extracted them to. If you think you might use this more often, put adb into your $PATH. Additional usage info can be found here.
You will need to enable Android debugging on your device. Details for doing that can vary with the device and Android version. Follow the instructions found here.
If using Windows, you may need to install a USB driver for your device, if you haven't already done so. See here for details.
For Linux, you may need to add a udev rules file. See here for details.
Note that your device may prompt you for access permission the first time you connect, so be sure to have it unlocked so you can see the prompt when connecting.
You can verify that your device is connected correctly by executing adb devices
from the platform-tools
folder. If connected, your device will be listed under the list of devices attached. If the device is listed but is shown as offline
, then try killing the adb server (see below), disabling Android debugging on the device, and then start over.
When done using adb, you can execute adb kill-server
to shut down the adb server on your computer and terminate the connection to your device. You can also disable Android debugging on the device, if you wish.