From Xamarin Studio, go to Tools, then select "Open Android SDK Command Prompt". This will open a terminal window and automatically navigate you to the Android SDK location. From there you can use the ADB command.
you must add the 'platform-tools' folder path to the Mac Terminal to run ADB and Fastboot commands. You can also do that by either manually typing the path to the folder containing ADB and Fastboot files or just by copying and pasting the folder path in the terminal.
The problem is: adb
is not in your PATH
. This is where the shell looks for executables. You can check your current PATH
with echo $PATH
.
Bash will first try to look for a binary called adb
in your Path, and not in the current directory. Therefore, if you are currently in the platform-tools
directory, just call
./adb --help
The dot is your current directory, and this tells Bash to use adb
from there.
But actually, you should add platform-tools
to your PATH
, as well as some other tools that the Android SDK comes with. This is how you do it:
Find out where you installed the Android SDK. This might be (where $HOME
is your user's home directory) one of the following (or verify via Configure > SDK Manager in the Android Studio startup screen):
$HOME/Android/Sdk
$HOME/Library/Android/sdk
Find out which shell profile to edit, depending on which file is used:
$HOME/.bashrc
$HOME/.bash_profile
$HOME/.zshrc
Open the shell profile from step two, and at the bottom of the file, add the following lines. Make sure to replace the path with the one where you installed platform-tools
if it differs:
export ANDROID_HOME="$HOME/Android/Sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
Save the profile file, then, re-start the terminal or run source ~/.bashrc
(or whatever you just modified).
Note that setting ANDROID_HOME
is required for some third party frameworks, so it does not hurt to add it.
For zsh
users. Add alias adb='/Users/<yourUserName>/Library/Android/sdk/platform-tools/adb'
to .zshrc
file.
Than run source ~/.zshrc
command
In addition to slhck, this is what worked for me (mac).
To check where your sdk is located.
File -> Project Structure -> Sdk location
Copy the path.
Create the hidden .bash_profile
in your home.
vim
, or open -e
) with the following:export PATH=/Users/<Your session name>/Library/Android/sdk/platform-tools:/Users/<Your session name>/Library/Android/sdk/tools:$PATH
. ~/.bash_profile
SO post on how to find adb devices
Pasting this command in terminal solves the issue in most cases:
~/.bash_profile
using vi ~/.bash_profile
and add this line to it: export PATH="~/Library/Android/sdk/platform-tools":$PATH
However, if not, continue reading.
Android Debug Bridge, or adb for short, is usually located in Platform Tools and comes with Android SDK, You simply need to add its location to system path. So system knows about it, and can use it if necessary.
Path to this folder varies by installation scenario, but common ones are:
If you have installed Android Studio somewhere else, determine its location by going to:
When you have determined ADB's location, add it to system, follow this syntax and type it in terminal:
(in macOS)
export PATH="your/path/to/adb/here":$PATH
for example: export PATH="~/Library/Android/sdk/platform-tools":$PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With