androidenvironment-variablesjava-home

Set ANDROID_HOME environment variable in mac


I am new in developing native app using Salesforce SDK. I tried to create android project from command line using forcedroid tool but there is problem in setting environment variable named ANDROID_HOME.

But i don't know how to set this variable.

I am attaching screenshot to describe my problem correctly.

enter image description here


Solution

  • Open the terminal and type :

    export ANDROID_HOME=/Applications/ADT/sdk
    

    Add this to the PATH environment variable

    export PATH=$PATH:$ANDROID_HOME/platform-tools
    

    If the terminal doesn't locate the added path(s) from the .zshrc, please run this command

    source ~/.zshrc

    Hope it works to you!