Installing the SDK
This page describes how to install the Android SDK and set up your development environment. If you haven't
downloaded the SDK yet, you can use the link below to get started. Then read the rest of this document to learn
how to install, configure, and use the SDK to create Android applications.
Upgrading?
If you have already developed applications using an earlier version of the
SDK, please skip this page and read the
Upgrading the SDK document.
System and Software Requirements
To develop Android applications using the code and tools in the Android SDK,
you need a suitable development computer and development environment, as described below.
Supported Operating Systems:
- Windows XP or Vista
- Mac OS X 10.4.8 or later (x86 only)
- Linux (tested on Linux Ubuntu Dapper Drake)
Supported Development Environments:
- Eclipse IDE
- Other development environments or IDEs
- JDK 5 or JDK 6 (JRE alone is not sufficient)
- Apache Ant 1.6.5 or later for Linux and Mac, 1.7 or later for Windows
- Not compatible with Gnu Compiler for Java (gcj)
Note: If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed above. In
particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.
Installing the SDK
After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named android_sdk_<platform>_<release>_<build>. The directory contains the subdirectories tools/, samples/, and others.
Make a note of the name and location of the unpacked SDK directory on your system — you will need to refer to the SDK directory later, when setting up the Android plugin or using SDK tools.
Optionally, you can add the path to the SDK tools directory to your path. As mentioned above, the tools/ directory is located in the SDK directory.
- On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look
for a line that sets the PATH environment variable and add the
full path to the
tools/ directory to it. If you don't
see a line setting the path, you can add one:
export PATH=${PATH}:<your_sdk_dir>/tools
- On a Mac, look in your home directory for .bash_profile and
proceed as for Linux. You can create the .bash_profile, if
you haven't already set one up on your machine.
- On Windows, right click on My Computer, and select Properties.
Under the Advanced tab, hit the Environment Variables button, and in the
dialog that comes up, double-click on Path under System Variables. Add the full path to the
tools/ directory to the path.
Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.
Installing the Eclipse Plugin (ADT)
If you will be using the Eclipse IDE as your environment for developing Android applications, you can install a custom plugin called Android Development Tools (ADT), which adds integrated support for Android projects and tools. The ADT plugin includes a variety of powerful extensions that make creating, running, and debugging Android applications faster and easier.
If you will not be using the Eclipse IDE, you do not need to download or install the ADT plugin.
To download and install the ADT plugin, follow the steps below for your respective Eclipse version.
| Eclipse 3.3 (Europa) | Eclipse 3.4 (Ganymede) |
- Start Eclipse, then select Help > Software Updates > Find
and Install....
- In the dialog that appears, select Search for new features to install and click Next.
- Click New Remote Site.
- In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:
https://dl-ssl.google.com/android/eclipse/
Click OK.
- You should now see the new site added to the search list (and checked).
Click Finish.
- In the subsequent Search Results dialog box, select the checkbox for
Android Plugin > Developer Tools.
This will check both features: "Android Developer Tools", and "Android
Editors". The Android Editors feature is optional, but recommended. If
you choose to install it, you need the WST plugin mentioned earlier in this
page.
Click Next.
- Read the license agreement and then select Accept terms of the license agreement.
Click Next.
- Click Finish.
- The ADT plugin is not signed; you can accept the installation anyway
by clicking Install All.
- Restart Eclipse.
|
- Start Eclipse, then select Help > Software Updates....
- In the dialog that appears, click the Available Software tab.
- Click Add Site...
- Enter this as the Location:
https://dl-ssl.google.com/android/eclipse/
Click OK.
- Back in the Available Software view, you should see the plugin. Select the checkbox next to
Developer Tools and click Install...
- On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked.
The Android Editors feature is optional, but recommended. If
you choose to install it, you need the WST plugin mentioned earlier in this
page.
Click Finish.
- Restart Eclipse.
|
After restart, update your Eclipse preferences to point to the SDK directory:
- Select Window > Preferences... to open the Preferences
panel. (Mac OS X: Eclipse > Preferences)
- Select Android from the left panel.
- For the SDK Location in the main panel, click Browse... and locate the SDK directory.
- Click Apply, then OK.
Troubleshooting ADT Installation
If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:
- In Step 4, try changing the remote update site URL to use
http, rather than https.
- If you are behind a firewall (such as a corporate firewall), make
sure that you have properly configured your proxy settings in Eclipse.
In Eclipse 3.3/3.4, you can configure proxy information from the main
Eclipse menu in Window (on Mac, Eclipse) > Preferences > General > Network Connections.
If you are still unable to use Eclipse to download the ADT plugin, follow these steps to download and install the plugin from your computer:
- Download the ADT zip file (do not unpack it).
- Follow steps 1 and 2 in the default install instructions (above).
- In Eclipse 3.3, click New Archive Site....
In Eclipse 3.4, click Add Site..., then Archive...
- Browse and select the downloaded the zip file.
- Follow the remaining procedures, above, starting from steps 5.
Note that to update your plugin, you will have to follow these steps again instead of the default update instructions.
Note that the "Android Editors" feature of ADT requires several optional
Eclipse components (for example, WST). If you encounter an error when
installing ADT, your Eclipse installion might not include those components.
For information about how to quickly add the necessary components to your
Eclipse installation, see the troubleshooting topic
ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".
Updating the ADT Plugin
In some cases, a new ADT plugin may become available for your existing version of the SDK. You can use the steps below to update
the ADT plugin from inside Eclipse.
| Eclipse 3.3 (Europa) | Eclipse 3.4 (Ganymede) |
- Select Help > Software Updates > Find and Install....
- Select Search for updates of the currently installed features and click Finish.
- If an update for ADT is available, select and install.
Alternatively,
- Select Help > Software Updates > Manage Configuration.
- Navigate down the tree and select Android Development Tools <version>
- Select Scan for Updates under Available Tasks.
|
- Select Help > Software Updates...
- Select the Installed Software tab.
- Click Update...
- If an update for ADT is available, select it and click Finish.
|
Installation Notes
Ubuntu Linux Notes
- If you need help installing and configuring Java on your
development machine, you might find these resources helpful:
- Here are the steps to install Java and Eclipse, prior to installing
the Android SDK and ADT Plugin.
- If you are running a 64-bit distribution on your development
machine, you need to install the
ia32-libs package using
apt-get::
apt-get install ia32-libs
- Next, install Java:
apt-get install sun-java6-bin
- The Ubuntu package manager does not currently offer an Eclipse 3.3
version for download, so we recommend that you download Eclipse from
eclipse.org (http://www.eclipse.org/
downloads/). A Java or RCP version of Eclipse is recommended.
- Follow the steps given in previous sections to install the SDK
and the ADT plugin.
Other Linux Notes