Tiffany B. Brown

a mish-mosh of stuff

Android 3.0 SDK on Mac OS X – Snow Leopard: Installation tips

It’s not as obvious as it seems in the Installing the SDK documentation. You’ll also need to do two (small) extra steps.

Step 1: Make sure your JAVA_HOME path is using the correct value

Edit or create a .bash_profile file in your home directory and add the following line.

export JAVA_HOME=`/usr/libexec/java_home`

This will set the JAVA_HOME environment variable to whichever version of the Mac OS X JDK is available. You can see which version is in use by firing up the Java Preferences application (in /Applications/Utilities)

Step 2: Use ./android instead of android to launch the SDK & AVD Manager

The documentation says On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute: android, but on the Mac, you actually have to type ./android.

That may be obvious to some, but for the n00bs among us, not so much :-) . You can then continue with the installation instructions.

  • http://myfreeweb.ru/ MyFreeWeb

    “./” means “in the current directory”. It doesn’t matter if it’s Mac or Linux. If you copy that stuff to a dir that’s in $PATH, or add that to $PATH, you’d be able to type just “android” from any directory.

  • Anonymous

    I am pretty sure I tried adding it to $PATH. I followed the directions. It’s possible that I did it wrong, but I know that ‘./android’ works where ‘android’ did not after navigating to the tools directory. That may well be an issue in the documentation.

  • http://bkaeg.org/blog AG

    Not sure if you’ve done this already, but it works for me. It’s probably old hat, but I thought it would be useful to share anyway.

    One way to ensure that your “tools” directory is indeed in your $PATH (where you expect)..
    1) Open a terminal and type “env” (environment) it should show the $PATH variable contents
    2) If you notice that the android tools directory is missing, simply modify your shell environment.rc file.
    3) Since you’re using OSX, I’d imagine this would be the .tcshrc (run your favorite editor and modify the $PATH statement as appropriate).
    4) Lastly, at the command line in a terminal source your .tcshrc – type “source .tcshrc” (without quotes) to make changes happen immediately in your current session.

    You should be able to run the android script without having to be in the source directory.
    Another sanity check would be to type “which android” or whatever your executable filename happens to be at the command line. This command should return to standard out the precise path you intended.

    hope this helps. Have fun!!

  • http://www.facebook.com/dallasgutauckis Dallas Gutauckis

    Right. This is documented on their ‘Installing the SDK’ page: http://developer.android.com/sdk/installing.html — look for ‘How to update your PATH’