Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 299
dharmendra vaishnav Avatar asked Feb 03 '15 10:02

dharmendra vaishnav


People also ask

How do I set environment variables in Big Sur Mac?

Open Terminal, then choose Terminal > Preferences. From the General pane, select ”Command (complete path).” In the field provided, enter one of the shell paths listed in /etc/shells, such as /bin/zsh, /bin/bash, /bin/csh, /bin/dash, /bin/ksh, /bin/sh, or /bin/tcsh.

What is Android_home path?

Variable name: ANDROID_HOME , Variable value: the path where you installed the android SDK, in my case is, C:\Android\android-sdk . You have to add the variable to the Path variable system by adding this: ;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools; .


2 Answers

To make it permanent on your system and the variable keep working after close the terminal, ou after a restart use:

nano ~/.bash_profile  

Add lines:

export ANDROID_HOME=/YOUR_PATH_TO/android-sdk export PATH=$PATH:$ANDROID_HOME/platform-tools export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/emulator 

Reopen terminal and check if it worked:

source ~/.bash_profile echo $ANDROID_HOME 
like image 102
Tiago Gouvêa Avatar answered Oct 19 '22 23:10

Tiago Gouvêa


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!

like image 45
Skizo-ozᴉʞS Avatar answered Oct 20 '22 01:10

Skizo-ozᴉʞS