ANDROID_HOME Error while while running Appium test case

I am trying to run my Appium test case from my eclipse, and it was running fine, suddenly there is an error now when I run the test case,

I googled and tried many solutions by setting up path for my android_home etc, but still issue exist, I am new to Mac and Appium, and I am not sure if some configuration changed when I was doing something or not, please check the error log

[debug] e[35m[W3C]e[39m Encountered internal error running command: Error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.

this is my bash profile when I do cat .bash_profile

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home

export PATH=$JAVA_HOME/bin:$PATH

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

export PATH="$ANDROID_HOME/platform-tools:${PATH}"

and below is the output from echo $PATH in my Mac terminal


I gave “usrName” instead of my name in the folder structure just for privacy

just an ad on,

when I give the below command on terminal,
open uiautomatorviewer

getting below response

01:33:48 E/adb: * daemon not running; starting now at tcp:5037

01:33:51 E/adb: * daemon started successfully

and my desired capabilities has the below code

driver = new AndroidDriver<>(new URL(""), capabilities);

@sarath_prasad correct it in a way like:

export ANDROID_HOME=/Users/YOUR_USER/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export JAVA_HOME=$(/usr/libexec/java_home)