adb command not found
adb command not found
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.
adb forward
When I run adb forward tcp:8080 tcp:8080
command I get the adb command not found
error message.
adb forward tcp:8080 tcp:8080
adb command not found
I can run android
command from terminal. Why adb
is not working?
android
adb
@AlexP. This post is older than the one you linked + already solved ...
– d0n.key
Jul 25 '18 at 22:06
16 Answers
16
Make sure adb
is in your user's $PATH variable.
adb
or
You can try to locate it with whereis
and run it with ./adb
whereis
./adb
./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
– Chris Stratton
Apr 24 '12 at 18:19
Yes I know :-) that's what I meant with finding it and running it from there
– kevoroid
Apr 24 '12 at 18:45
export to $Path in your ~/bashrc
– Aadishri
Oct 23 '13 at 7:40
Just curious, could you write out the full command.
– JGallardo
Oct 30 '14 at 18:44
could try ~/Library/Android/sdk/platform-tools/adb
– Pnar Sbi Wer
Apr 5 '18 at 2:29
In my case with Android Studio 1.1.0 path was this
/Users/wzbozon/Library/Android/sdk/platform-tools
/Users/wzbozon/Library/Android/sdk/platform-tools
Add the following to ~/.bash_profile
~/.bash_profile
export PATH=~/Library/Android/sdk/tools:$PATH
export PATH=~/Library/Android/sdk/platform-tools:$PATH
I also need to run
source ~/.bash_profile
to make it work– Phan Van Linh
Dec 4 '18 at 6:20
source ~/.bash_profile
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
export PATH=$PATH:~/android-sdks/platform-tools
Selected answer should be edited/completed with this, because adb moved for a long time and the adb_has_moved.txt is not there anymore
– Serty Oan
Feb 2 '15 at 20:13
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
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:
Run the following command on your Mac and restart your Terminal session:
echo export "PATH=~/Library/Android/sdk/platform-tools:$PATH" >> ~/.bash_profile
On my Mac (OS X 10.8.5) I have adb here:
~/Library/android-sdk-mac_86/platform-tools
So, edit the $PATH
in your .bash_profile
and source
it.
$PATH
.bash_profile
source
More recently this is
~/Library/android/sdk/platform-tools/
on macOS.– Jk Jensen
Nov 16 '18 at 3:53
~/Library/android/sdk/platform-tools/
Mac users just open /Users/(USERNAME)/.bash_profile
this file in a editor.
and add this line to add path.
/Users/(USERNAME)/.bash_profile
export PATH="/Users/myuser/Library/Android/sdk/platform-tools":$PATH
this is the default path if you install adb via studio.
and dont forget to change the username in this line.
export PATH="~/Library/Android/sdk/platform-tools":$PATH should do it, no need to change anything
– leyreyyan
Jul 5 '18 at 6:09
To avoid rewriting the $PATH variables every time you start a terminal, edit your .bash_profile (for Macs, it's just .profile) file under your home directory (~/), and place the export statement somewhere in the file.
Now every time you start terminal, your $PATH variable will be correctly updated. To update the terminal environment immediately after modifying the profile file, type in:
source ~/.profile
nano /home/user/.bashrc
export ANDROID_HOME=/psth/to/android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
However, this will not work for su/ sudo. If you need to set system-wide variables, you may want to think about adding them to /etc/profile, /etc/bash.bashrc, or /etc/environment.
ie:
nano /etc/bash.bashrc
export ANDROID_HOME=/psth/to/android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
If you don't want to edit PATH
variable, go to the platform-tools
directory where the SDK
is installed, and the command is there.
PATH
platform-tools
SDK
You can use it like this:
Go to the directory where you placed the SDK
:
SDK
cd /Users/mansour/Library/Developer/Android/sdk/platform-tools
cd /Users/mansour/Library/Developer/Android/sdk/platform-tools
Type the adb
command with ./
to use it from the current directory.
adb
./
./adb tcpip 5555
./adb tcpip 5555
./adb devices
./adb devices
./adb connect 192.168.XXX.XXX
./adb connect 192.168.XXX.XXX
in my case I added the following line in my terminal:
export PATH="/Users/Username/Library/Android/sdk/platform-tools":$PATH
make sure that you replace "username" with YOUR user name.
hit enter then type 'adb' to see if the error is gone. if it is, this is what you should see:
Android Debug Bridge version 1.0.40
...followed by a bunch of commands..and ending with this:
$ADB_TRACE
comma-separated list of debug info to log:
all,adb,sockets,packets,rwx,usb,sync,sysdeps,transport,jdwp
$ADB_VENDOR_KEYS colon-separated list of keys (files or directories)
$ANDROID_SERIAL serial number to connect to (see -s)
$ANDROID_LOG_TAGS tags to be used by logcat (see logcat --help)
if you get that, run npm run android again and it should work..
This is the easiest way and will provide automatic updates.
install homebrew
ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install adb
brew cask install android-platform-tools
Start using adb
adb devices
UNABLE TO LOCATE ADB #SOLVED
Simply Download Sdk platform tools.https://developer.android.com/studio/releases/platform-tools.html
Extract the Downloaded file.
Go to Sdk Manager in Android Studio and copy the link. Go to file Explorer and paste the path for Sdk you copied to view the Sdk files. You will notice that the Adb file is missing, open downloaded file (platform tools) copy contents and replace every content in your Sdk tool file (the file where you noticed adb is missing)and save. You are good to go.
In my case this is the solving of this problem
Make sure you have installed the android SDK. Usually the location of SDK
is located to this location
/Users/your-user/Library/Android/sdk
After that cd to that directory.
Once you are in that directory type this command
./platform-tools/adb install your-location-of apk
if youd dont have adb in folder android-sdk-macosx/platform-tools/
you should install platform tools first. Run android-sdk-macosx/tools/android
and Install platform tools from Android SDK manager.
android-sdk-macosx/platform-tools/
android-sdk-macosx/tools/android
I solved this issue by install adb package. I'm using Ubuntu.
sudo apt install adb
I think this will help to you.
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
stackoverflow.com/q/17901692/1778421
– Alex P.
Jul 23 '18 at 13:58