Setup Android SDK Home in Your Mac Permanantly ($ANDROID_HOME)

Hello,

Welcome to short tutorial about how to setup Android SDK Home in Mac OS X.  Setting up android SDK home will be helpful in many situations. I will list out some situations,

 

  1. When you are working with Jenkins in your local Pc.
  2. When you are working with Appium Test Automation framework.
  3. Background apps trying to access Android SDK, needed ANDROID_HOME.

 

I assume that you have already downloaded and installed the Android SDK.

 

Open Your terminal and edit the [code]

<span class="pln">bash_profile</span>

[/code]

You can use nano or VI editor.

[code]


<span class="pln">vi </span><span class="pun">~/.</span><span class="pln">bash_profile</span>

[/code]

 

and paste this following configurations in the file and save.

 

[code]


<span class="kwd">export</span><span class="pln"> ANDROID_HOME</span><span class="pun">=</span><span class="str">/YOUR_PATH_TO/</span><span class="pln">android</span><span class="pun">-</span><span class="pln">sdk
</span><span class="kwd">export</span><span class="pln"> PATH</span><span class="pun">=</span><span class="pln">$ANDROID_HOME</span><span class="pun">/</span><span class="pln">platform</span><span class="pun">-</span><span class="pln">tools</span><span class="pun">:</span><span class="pln">$PATH
</span><span class="kwd">export</span><span class="pln"> PATH</span><span class="pun">=</span><span class="pln">$ANDROID_HOME</span><span class="pun">/</span><span class="pln">tools</span><span class="pun">:</span><span class="pln">$PATH</span>

[/code]

 

After you save, Make sure you to close and re-open the terminal.

 

try this,

[code]

<span class="pln">
echo $ANDROID_HOME</span>

[/code]

 

It should print your SDK path correctly.

 

[code]

MacBook-Pro:~Admin$ echo $ANDROID_HOME

<span class="str">YOUR_PATH_TO/</span><span class="pln">android</span><span class="pun">-</span><span class="pln">sdk</span>

[/code]

 

How to check the Add ANDROID_HOME Path is correct

 

open terminal and type this command,

 

[code]

MacBook-Pro:~ admin$ vi ~/.bash_profile

[/code]

 

Now, It should show correctly like above.

 

[code]


<span class="kwd">export</span><span class="pln"> ANDROID_HOME</span><span class="pun">=</span><span class="str">/YOUR_PATH_TO/</span><span class="pln">android</span><span class="pun">-</span><span class="pln">sdk
</span><span class="kwd">export</span><span class="pln"> PATH</span><span class="pun">=</span><span class="pln">$ANDROID_HOME</span><span class="pun">/</span><span class="pln">platform</span><span class="pun">-</span><span class="pln">tools</span><span class="pun">:</span><span class="pln">$PATH
</span><span class="kwd">export</span><span class="pln"> PATH</span><span class="pun">=</span><span class="pln">$ANDROID_HOME</span><span class="pun">/</span><span class="pln">tools</span><span class="pun">:</span><span class="pln">$PATH</span>

[/code]

 

 

 

Cheers…!

 

 

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.