vim ~/.bash_profile
Then add the following environment variables:
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export ANDROID_AVD_HOME=~/.android/avd
Android path might be different, if so change it accordingly. At last, to refresh the terminal to apply changes:
source ~/.bash_profile