I have installed Android SDK and Eclipse on my Mac system. I am able to program using Eclipse and have created few sample applications. But I am still not able to access
run command in terminal nano $HOME/.zshrc
Must include next lines:
export PATH=$PATH:~/Library/Android/sdk/platform-tools
export ANDROID_HOME=~/Library/Android/sdk
export PATH="$HOME/.bin:$PATH"
export PATH="~/Library/Android/sdk/platform-tools":$PATH
Press Command + X to save file in editor,Enter Yes or No and hit Enter key
Run source ~/.zshrc
Check adb in terminal, run adb
This worked for me on my MAC - 2020
Go to directory containing adb:
cd ~/Library/Android/sdk/platform-tools/
Run adb command to list all services
./adb shell dumpsys activity services
For Mac OS Catalina or Mojave
Enter command to open nano editor
nano $HOME/.zshrc
Set PATH variable, means append more path as shown here
FLUTTER_HOME="/Users/pankaj/Library/Android/flutter-sdk/flutter/bin"
DART_HOME="/Users/pankaj/Library/Android/flutter-sdk/flutter/bin/cache/dart-sdk/bin"
ANDROID_SDK_HOME="/Users/pankaj/Library/Android/sdk"
ANDROID_ADB_HOME="/Users/pankaj/Library/Android/sdk/platform-tools"
PATH="$PATH:$FLUTTER_HOME"
PATH="$PATH:$DART_HOME"
PATH="$PATH:$ANDROID_SDK_HOME"
PATH="$PATH:$ANDROID_ADB_HOME"
Now press Command + X to save file in editor,Enter Yes or No and hit Enter key.
For zsh
users. Add alias adb='/Users/<yourUserName>/Library/Android/sdk/platform-tools/adb'
to .zshrc
file.
Than run source ~/.zshrc
command
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":$PATHHowever, 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
For Mac, Android Studio 3.6.1, I added this to .bash_profile
export PATH="~/Library/Android/sdk/platform-tools/platform-tools":$PATH