Home > Android, Development, Mac OS X > Setting Android and Path environment variables on Mac OS X

Setting Android and Path environment variables on Mac OS X

When bash starts it reads the following files every time you login. For the purposes of OS X, this means every time you open a new Terminal window.

  • /etc/profile
  • ~/.bash_profile
  • ~/.bash_login (if .bash_profile does not exist)
  • ~/.profile (if .bash_login does not exist)

When you start a new shell by typing bash on the command line, it reads .bashrc

Finally, OS X also uses ~/.MacOSX/environment.plist to set more environment variables, including paths if necessary.

Add Android and PATH variables to ~/.profile, e.g.:

export ANDROID_HOME=/Users/cduu/Development/bin/android-sdk/android-sdk_r15-macosx_x86
export PATH=/Users/cduu/Development/bin/android-sdk/android-sdk_r15-macosx_x86/platform-tools:/Users/cduu/Development/bin/android-sdk/android-sdk_r15-macosx_x86/tools:$PATH

Check environment variables in a new Terminal with:

set
About these ads
Categories: Android, Development, Mac OS X
  1. Saurabh
    January 3, 2012 at 17:10

    Thanks a lot :)

  2. Chai
    February 7, 2013 at 21:12

    Awesome.. saved a ton of time :)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: