NativeScript ANDROID_HOME missing

If you're using bash then you need to update the ~/.bash_profile file. In my case, I'm using ZSH so I needed to edit ~/.zshrc file.

nano ~/.zshrc

Add the export line below:

if [ -f /Users/{myusername}/.tnsrc ]; then
    source /Users/{myusername}/.tnsrc
    export ANDROID_HOME=/Users/{myusername}/Library/Android/sdk
fi

Ctrl + O to save, Ctrl + X to exit. Restart the terminal. Now echo $ANDROID_HOME shows the correct path every time.


Open/create .profile like this

vim ~/.profile

add the following lines to the end of the .profile file.

export ANDROID_HOME=${HOME}/Library/Android/sdk

load the profile using the command

source ~/.profile

You should have it working I guess. This is what I did to get this configured.