Android Debug Bridge (ADB)
Android Debug Bridge (ADB)
It's a command line tool that let's you send instructions to emulators or devices.
Use case :
- Go to terminal
- run command : $ adb
if we get adb: command not found we have to add the adb to our path
- To use this command line, it needs to be part of our path.
- First we find where the adb executables live
- Then we add them to our path
Follow the Steps to add the Adb to your path
1. Find the platform-tools folder which contains adb:
Adb is part of the Android SDK, which is downloaded as part of Android Studio. You can find the location of this SDK by going to Tools -> SDK Manager

ADB is located in this location, followed by platform-tools/ so in the example above, you could find adb in:
/Users/lmf/Library/Android/sdk/platform-tools/
2. Add adb to your path:
Adding a variable to your path varies by platform, follow the instructions below to add the platform-tools location you located above.
Windows
- Go to Advanced system settings:
- Windows 8 and 10: Search -> System (Control Panel) -> Advanced system settings
- Windows 7: Right-click Computer -> Properties -> Advanced system settings
- Windows Vista: Right click My Computer -> Properties -> Advanced system settings
- Windows XP: Start -> Control Panel -> System -> Advanced tab
- Click Environment Variables
- Find the System Variables section and then look to see if you have a PATH environment variable:
- If you find one, click Edit
- If you do not find one, click New to add one
- Add
;<Path to platform-tools>
to the end of the Variable value box - Click OK on all windows to save
- Ensure you can run adb by typing:
adb
- You should see output, including something like: Android Debug Bridge version 1.x.x
Mac/Linux
Adding a path variable is done using the terminal on Mac/Linux.
- Open a Terminal
- Create a .bash_profile file if you don’t have one already. This is a configuration file for bash) - it’s executed when you start bash:
touch ~/.bash_profile
- Open up the ~/.bash_profile file in your preferred text editor:
open ~/.bash_profile
- Add the following to your .bash_profile file and save:
export PATH=<Path to platform-tools>:$PATH
- Either restart your terminal, or enter:
source ~/.bash_profile
- Ensure you can run adb by typing:
adb
- You should see output, including something like: Android Debug Bridge version 1.x.x
Terminating process in your app
Run this command :
adb shell am kill
com.niranjan.mycoolapp
Comments
Post a Comment