Introduction to Android Application Development Part 3: Installing Android 2.0 SDK on a Mac
June 10, 2010 20 CommentsHere’s a repost of an earlier blog post for everyone at the Humanities Gaming Institute.
Lately I’ve updated to Android 2.0 SDK. In the process I noticed that things were slightly different. Following my motto of “Scratching my head so you don’t have to,” I’ve decided to document the new process of installing the SDK from scratch. (And I mean from scratch… I just freshly installed Mac OSX yesterday.)
System Details:
Here are some details on my system so you know what environment I’m working in:
Essentially I’m running a white MacBook about a year and a half old… Theoretically this install should work with any Mac.
Step 1: Get Eclipse
If you already have eclipse feel free to skip this step, but I was serious about documenting the process from scratch…
Grab the Android SDK from the Android website. Choose the proper SDK for your environment (which would be Mac OSX) and download. Unzip this to an appropriate place as well. Again I just dump it to my documents folder.
Step 3: (Optional but highly recommended) Add /tools to you $PATH variable
Now to make your life easier if you ever plan on doing anything remotely involved with android, add the /tools directory within the SDK folder to your $PATH variable. This allows you to easily invoke the tools found in the folder, such as adb quickly from a terminal window.
To edit your path variable:
- Open a terminal window
- Edit your .bash_profile file (its ok if this doesn’t exist yet. I just edit by nano .bash_profile
) - Add
export PATH=${PATH}:<your_sdk_dir>/toolsto the open file. I usually make sure i get this right by popping open another terminal window and cd-ing until I’m in the /tools directory, typing pwd and copying and pasting the results. My .bash_profile file now reads: export PATH=${PATH}:/Users/myusername/Documents/android-sdk-mac/tools - Save and close. To do this with nano use <ctrl>+<x> , <y>, <enter>
- To test whether your $PATH variable has changed, close all terminal windows, open a new one and type in $PATH. Something like -bash: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/usernamehere/Documents/android-sdk-mac/tools: No such file or directory should appear.
Step 4: Install the Eclipse Plugin
Now we have to install the Eclipse plugin for Android development
- Open Eclipse
- Goto Help > Install New Software
- Click Add
- In the resulting popup box type Android ADT Plugin (or something similar) into the name field
- Type https://dl-ssl.google.com/android/eclipse/ into the Location field
- Press OK
- Check the box next to ‘Developer Tools’

- Click Next.
- Accept the liscense agreememts
- Click Finish
At this point, the plugin should install. After installation Eclipse will prompt you to restart it.
Step 5: Adding SDK Components
Here’s where things are different. Instead of installing the SDK for a given version of Android, we now install SDK Components for that version of Android. This allows us to test against many different versions of Android easily and make sure that that prized application we’ve worked on for the past several months works on Android 1.5, 1.6, 2.0, and over 9,000
- Open the preferences pane. This can be done easily by the keyboard shortcut <cmnd> + <,>.
- Click Android on the left pane as shown below
- In the field SDK Location fill in the directory where you unzipped the SDK
- Click Apply then Ok
- Goto Available Packages, check the box next to the website listed, and check the components you want to install. Click Install Selected. Accept all and Install. This will be how you install new Android versions.
Now you should be ready to go and start developing Android applications! If you have any trouble following anything listed above, leave a comment and I’ll help remedy the situation.
|
|
|
|
|
![]() |
Programming







[...] The following instructions assume you’ve downloaded and installed the Android SDK, and added the /tools directory to your system’s $PATH variable. For instructions on how to do this, see my earlier post Installing Android 2.0 SDK on a Mac. [...]
[...] The following instructions assume you’ve downloaded and installed the Android SDK, and added the /tools directory to your system’s $PATH variable. For instructions on how to do this, see my earlier post Installing Android 2.0 SDK on a Mac. [...]
Awsome but I still dont understand the .bash_profile part
The .bash_profile part is so that you can easily execute commands from the terminal to your phone. If you add the /tools/ directory of the SDK to your $PATH variable, this allows you to be able to just type
adbto execute a command on your phone. Which part don’t you understand? Essentially the process involves opening a terminal, editing a system file, and restarting the terminal to make sure everything worked out fine…Sorry wouldnt allow me to re reply but basically everything im just learning to code i got my droid yesturday and wanted to try it out thanks for the help!
Here are the steps you’re going to take:
I get this /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin: No such file or directoryand i did this nano .bash_profileexport PATH=${PATH}:/Users/RileyPhoto/Droid/android-sdk-mac_86/tools<ctrl>+x, y, “SAVED “OVERWROTE” BUT DID NOT CLOSE”"I closed terminali typed $PATHAnd got /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin: No such file or directory
what does cat
.bash_profilereturn?patrick-rileys-imac:~ RileyPhoto$ cat .bash_profilecat: .bash_profile: No such file or directorypatrick-rileys-imac:~ RileyPhoto$ .bash_profile-bash: .bash_profile: command not foundpatrick-rileys-imac:~ RileyPhoto$
Do you have a messenger (gtalk / aim /etc) I can use to help walk you through this? It seems that you never saved the .bash_profile file.
yapatrickrileyjunk@gmail.com
the ya isnt part of it
Ok so I’ve done all the steps listed except the path variable one.I don’t have a clue what I’m doing there so thought I’d best not mess this up.Correct me if I’m wrong, but I still don’t see how this means I will have Android 2.0 on my G1…there’s nothing about how to get this on the phone.I’ve previously rooted to Cupcake and there were parts were I had to install update.zip files…maybe I’m missing something entirely but if someone could help me out that would be great. my email: cerys_mt@hotmail.co.ukThanks!
Okay now I’ve done the path variable bit and seen the links at the bottom of the post but both are broken. If someone could email me the next steps I’d be super grateful. My Macbooks currently downloading all the SDK Platforms so I need the steps from there i.e. connecting the phone and getting it on 2.0Thanks
[...] Installing Android 2.0 SDK upon the Mac | DroidWeb [...]
[...] Installing Android 2.0 SDK upon the Mac | DroidWeb [...]
[...] eclipse to take screenshots of your phone. I published an article on how to install the SDK here: Installing Android 2.0 SDK on a Mac | DroidWeb. Let me know if you need any help __________________ Looking for app ideas to work on ===== [...]
Thanks man. It would be great if you could add the simulator start from the AVD too. It makes people happy to see that android is running =D
Will do. I have it planned for an upcoming part of the tutorial
Your PATH explanation helped me out greatly. Thanks for the superb write up and attn. to details! Warmest regards.