adb command not found
Solution 1
Make sure adb
is in your user's $PATH variable.
or
You can try to locate it with whereis
and run it with ./adb
Solution 2
In my case with Android Studio 1.1.0 path was this
/Users/<username>/Library/Android/sdk/platform-tools
Add the following to ~/.bash_profile
export PATH=~/Library/Android/sdk/tools:$PATH
export PATH=~/Library/Android/sdk/platform-tools:$PATH
Solution 3
Is adb installed? To check, run the following command in Terminal:
~/Library/Android/sdk/platform-tools/adb
If that prints output, skip these following install steps and go straight to the final Terminal command I list:
- Launch Android Studio
- Launch SDK Manager via Tools -> Android -> SDK Manager
- Check Android SDK Platform-Tools
Run the following command on your Mac and restart your Terminal session:
echo export "PATH=~/Library/Android/sdk/platform-tools:$PATH" >> ~/.bash_profile
Note: If you've switched to zsh, the above command should use .zshenv
rather than .bash_profile
Solution 4
I am using Mac 10.11.1 and using android studio 1.5, I have my adb "/Users/user-name/Library/Android/sdk/platform-tools"
Now edit you bash_profile
emacs ~/.bash_profile
Add this line to your bash_profile, and replace the user-name with your username
export PATH="$PATH:/Users/user-name/Library/Android/sdk/platform-tools"
save and close. Run this command to reload your bash_profile
source ~/.bash_profile
Solution 5
From the file android-sdks/tools/adb_has_moved.txt:
The adb tool has moved to platform-tools/
If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and install "Android SDK Platform-tools"
Please also update your PATH environment variable to include the platform-tools/ directory, so you can execute adb from any location.
so on UNIX do something like:
export PATH=$PATH:~/android-sdks/platform-tools
Related videos on Youtube
coure2011
Updated on July 19, 2022Comments
-
coure2011 almost 2 years
I need to run an
adb forward
command before I could use the ezkeyboard application which allows user to type on the phone using browser.When I run
adb forward tcp:8080 tcp:8080
command I get theadb command not found
error message.I can run
android
command from terminal. Whyadb
is not working?-
Alex P. almost 6 years
-
d0n.key almost 6 years@AlexP. This post is older than the one you linked + already solved ...
-
kreker over 2 years
-
-
Chris Stratton about 12 years./adb would only work if the current directory (which is what . is shorthand for) is the location of the adb program. Otherwise it would be /some/path/found/by/wheris/adb
-
kevoroid about 12 yearsYes I know :-) that's what I meant with finding it and running it from there
-
Aadishri over 10 yearsexport to $Path in your ~/bashrc
-
Serty Oan over 9 yearsSelected answer should be edited/completed with this, because adb moved for a long time and the adb_has_moved.txt is not there anymore
-
Pnar Sbi Wer about 6 yearscould try ~/Library/Android/sdk/platform-tools/adb
-
yuzuriha almost 6 yearsexport PATH="~/Library/Android/sdk/platform-tools":$PATH should do it, no need to change anything
-
Jk Jensen over 5 yearsMore recently this is
~/Library/android/sdk/platform-tools/
on macOS. -
Linh over 5 yearsI also need to run
source ~/.bash_profile
to make it work -
n3wbie over 4 years@Gowtham Sooryaraj those paths are where the tools are located. Adding them to the PATH variable of your env allows you to access the tools (adb here) whithout the need to give the full path of its location (~/Library/Android/sdk/platform-tools/adb). When you type adb in your terminal, its seeks a similar tool in all the paths of the env PATH variable. I hope it helps :)
-
Mike Collins about 4 yearsYou shouldn’t need to be in the platform-tools directory. That means your PATH isn’t set correctly and you’d be better off following one of the other answers here.
-
Mike Collins about 4 yearsYou should add the appropriate export statement to this answer.
-
mokagio about 4 yearsThis did it for me too. I bumped into it while using Fastlane's screengrab. Thanks!
-
Andrey Aleev almost 4 yearsThank you very much! For zsh your answer with .zshenv worked for me while other answer suggesting .zshrc didn't.
-
Tyler Pfaff over 3 yearsI have to run
source ~/.bash_profile
all the time, what does it do? -
Mike Collins over 3 years@TylerPfaff it reloads your shell profile. Closing your terminal and reopening it has the same effect.
-
kca over 3 yearscould try
~/Android/Sdk/platform-tools/adb
(in Ubuntu 20.04) -
Masoud Darzi over 3 yearsthe answer is correct but just if the shell is zsh you have to change .bash_profile to .zshenv
-
sina farbod about 3 yearsbrew install --cask android-platform-tools in 2021
-
Jay Smoke over 2 yearsFour years later and this is still very much helpful. Thank You
-
luis.ap.uyen over 2 yearsThe last command is what allowed me to run adb from anywhere in the console. That final tweak was missing in other answers
-
Rik over 2 yearsOn Debian, using Arctic Fox, its:
~/Android/Sdk/platform-tools/adb <remaining-command-parts>
to run an adb command with out it added to path (that's its latest location). So you'll want toexport PATH=~/Android/Sdk/platform-tools:$PATH
. Definitely run asource ~/.bash_profile
orsource ~/.bashrc
, depending on where you put it, if you don't want to restart your terminal. -
german1311 over 2 yearsAppend values to
.zprofile
file for those who use zsh -
user1034912 about 2 yearsdoes this set the path as well?
-
room_n almost 2 yearsThis is the working solution for me. Thanks!