Tutorials Android Setting ANDROID_HOME Environmental Variable on Mac

Setting ANDROID_HOME Environmental Variable on Mac

In this tutorial, we will show you how to set ANDROID_HOME Environmental Variable on Mac OS X.

Setting ANDROID_HOME environmental variable on Maverick Mac OS X Lion (10.7.5)

The ANDROID_HOME environment variable can be used to tell maven where to find the Android SDK. In your home directory, add a file called .bash_profile

Set the ANDROID_HOME variable to your SDK directory example,

export ANDROID_HOME=/Users/alebirke/apps/adt-bundle-mac-x86_64/sdk

Setting ANDROID_HOME environmental variable on Maverick Mac OS X (10.9.x)

Configure the ANDROID_HOME environment variable based on the location of the Android SDK. Additionally, consider adding ANDROID_HOME/tools, and ANDROID_HOME/platform-tools to your PATH.

$  export ANDROID_HOME=/Users/Neel/Documents/Softwares/adt-bundle-mac-x86_64-20140321/sdk
$  export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Setting ANDROID_HOME environment variable to .bash_profile

Open the Terminal program present in your (this is in your Applications/Utilities folder by default). Follow the below steps.

Step-1

Start up Terminal and go to your home folder.

cd ~/

Step-2

Open and edit .bash_profile file

$ open -e .bash_profile

If you don’t have .bash_profile file in your computer path, then create one. Enter below command to create a new file. Once created follow Step-2.

touch .bash_profile

Step-3

Save the below line)

export PATH=${PATH}:/Applications/adt-bundle-mac-x86_64-20140321/sdk/tools
export PATH=${PATH}:/Applications/adt-bundle-mac-x86_64-20140321/sdk/platform-tools

 Step-4

Refresh the file using below command

$ source .bash_profile

Step-5

Check if the JAVA_HOME is set properly

$ echo $PATH

You will see the result similar to below. Find for your path in there. If available, then you are good

/Users/Neel/.rvm/gems/ruby-2.1.2/bin:/Users/Neel/.rvm/gems/ruby-2.1.2@global/bin:/Users/Neel/.rvm/rubies/ruby-2.1.2/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/adt-bundle-mac-x86_64-20140321/sdk/tools:/Applications/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:/Users/Neel/.rvm/bin

Alternatively, You can run android command, it will start android SDK manager

Total
0
Shares
guest
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Alex
Alex
7 years ago

Thank You So Much!!

I’ve been stuck with this problem for a long time.

jag
jag
7 years ago

Awesome worked like a charm

The One
The One
6 years ago

Thank you for this article, it saved me 🙂

priyanka
priyanka
6 years ago

where to download and how to install android studio on mac? where to put android sdk folder on mac? what are the pre-requisites for android studio?
is there need to set environment variable for that?

Previous Post
Copying the Contents of One text file to Another in Java

Java Servlet Hello World Example

Next Post

How to Install Node.js Mac OS X

Related Posts
By clicking “Allow All”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Cookie Notice
Allow All
4
0
Would love your thoughts, please comment.x
()
x