zsh: command not found: adb in mac OS

I am getting zsh: command not found: adb error even after updating my bash-profile.
I have added the following path in my bash-profile

# For ADB
export ANDROID_HOME=/Users/aanshu/Library/Android/sdk/platform-tools/adb
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH

declare -p PATH is returning the following path

export -T PATH path=( /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /Users/aanshu/.nvm/versions/node/v12.16.1/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/Apple/usr/bin )

>Solution :

export ANDROID_HOME=/Users/aanshu/Library/Android/sdk/platform-tools/adb

…is obviously wrong. It should instead be:

export ANDROID_HOME=/Users/aanshu/Library/Android/sdk

…because it provides a base to which the subsequent lines append.

Leave a Reply