General Instructions
Prepare your Computer
- Make sure your system meets the minimum requirements
- Make sure you have installed the Java Development Kit
- (Optional) Install Eclipse IDE
- Eclipse classic is recommended.
Download the SDK Starter Package
The SDK starter package is not a full development environment—it includes only the core SDK Tools, which you can use to download the rest of the SDK components (such as the latest Android platform).
- Download the latest SDK Starter Package
(Optional) Install ADT Plug-in for Eclipse
- If you use Eclipse, download the ADT Plug-in
Download platforms and other components
- Eclipse: Select Window » Android SDK and AVD Manager
- Windows: Double-click the SDK Manager.exe file at the root of the Android SDK directory
- Mac or Linux: Open a terminal and navigate to the /tools directory in the Android SDK, then execute
./android
Available Components
By default, there are two repositories of components for your SDK: Android Repository and Third party Add-ons.
The Android Repository offers these components:
- SDK Tools (pre-installed in the Android SDK starter package) — Contains tools for debugging and testing your application and other utility tools. You can access these in the <sdk>/tools/ directory of your SDK and read more about them in the Tools section of the developer guide.
- SDK Platform-tools — Contains tools that are required to develop and debug your application, but which are developed alongside the Android platform in order to support the latest features. These tools are typically updated only when a new platform becomes available. You can access these in the <sdk>/platform-tools/ directory. Read more about them in the Tools section of the developer guide.
- Android platforms — An SDK platform is available for every production Android platform deployable to Android-powered devices. Each platform component includes a fully compliant Android library and system image, sample code, emulator skins, and any version specific tools. For detailed information about each platform, see the overview documents available under the section "Downloadable SDK Components," at left.
- USB Driver for Windows (Windows only) — Contains driver files that you can install on your Windows computer, so that you can run and debug your applications on an actual device. You do not need the USB driver unless you plan to debug your application on an actual Android-powered device. If you develop on Mac OS X or Linux, you do not need a special driver to debug your application on an Android-powered device. (See Developing on a Device for more information about developing on a real device.)
- Samples — Contains the sample code and apps available for each Android development platform. If you are just getting started with Android development, make sure to download the samples to your SDK.
- Documentation — Contains a local copy of the latest multiversion documentation for the Android framework API.
OS Specific Instructions
Linux
ArchLinux
The package android-sdk is included in AUR. No further changes are needed.
Gentoo Linux
- emerge dev-util/android-sdk-update-manager
- run /opt/android-sdk-update-manager/tools/android
- install platform-tools package
- ADB will be at /opt/android-sdk-update-manager/platform-tools/adb
- Edit your .bashrc file and add this line:
export PATH="/opt/android-sdk-update-manager/platform-tools/:${PATH}"
Ubuntu Linux
- Follow the General Instructions above.
- Setup udev.
Mac OS X
Installing the Android SDK
- Download the latest version of the Android SDK
- Unzip it and move it where needed
unzip Downloads/android-sdk_r09-mac_86.zip -d~/bin
- Open Terminal.app (in /Applications/Utilities)
- Edit ~/.profile and append
export PATH=~/bin/android-sdk_r09-mac_86/platform-tools:~/bin/android-sdk_r09-mac_86/tools:$PATH
- Load new .profile
source .profile
- Run Android SDK Manager
android
- Install Components
Installing Eclipse
- Download the latest version of Eclipse (Classic or Java Developers are probably best)
- Open Terminal.app (in /Applications/Utilities)
- Unzip it and move it where needed.
tar -zxvf Downloads/eclipse-java-helios-SR1-macosx-cocoa-x86_64.tar.gz
- Optional: Add to PATH. Edit ~/.profile and append
export PATH=[eclipse folder]:$PATH
then reloadsource .profile
.
- Open Eclipse.
- Open Preferences, go to Android. Set your SDK location. Click OK.
- Go to Help » Install New Software.
- Click Add.
- Name: Google ADT
- Location: https://dl-ssl.google.com/android/eclipse/
- Install pieces that you want.
Windows
- Download the latest Android SDK (preferably the zip file not the exe).
- Unzip the package to the root of C:\.
- NOTE: This will output a folder called "android-sdk-windows".
- Open up the android-sdk-windows folder and launch the SDK Manager.
- When you launch the SDK Manager for the first time it will ask for which packages to install. The only package we are concerned with at this time is "Android SDK Platform-tools, revision 6". You can reject all the others if you are not interested in them.
- Once that is finished, you will need to install the USB drivers included with the Android SDK.
- Click on"Available Packages" on the left.
- Expand "Third party Add-ons".
- Expand "Google Inc. add-ons".
- Check "Google USB Driver package, revision 4".
- Installed Selected.
- Once that's finished installing, you can close the SDK Manager.
- Go to the Control Panel, and select the System Properties (Windows XP) or System (Windows Vista/7).
- Select the Advanced settings;
- Windows XP: Click on the Advanced tab.
- Windows Vista/7: Click on Advanced system settings on the left.
- Click on Environment Variables.
- Under the "System variable" section, you will look for "Path". Double-click on it.
- In the "Variable values" section, add at the very end the location of the tools & package-tools folder, with a semicolon separating these two paths from the rest, e.g. %SystemRoot%;C:\android-sdk-windows\platform-tools;C:\android-sdk-windows\tools.
- On the device, ensure that USB Debugging is enabled (Settings » Applications » Development).
- Plug the device into the computer via USB cable. The computer will attempt to install the drivers automatically.
- On success, open the command prompt on the computer, and type in the following command to sure everything is setup properly:
adb devices
- If it lists any devices, everything is fine and you are finished. If not, the drivers may not be installed correctly, please continue.
- Open the Device Manager.
- Right-click on My Computer (Windows XP) or Computer (Windows Vista/7).
- Click on Manage.
- Click on Device Manager on the left.
- You will probably see Unknown Device with ADB listed under it with a yellow exclamation mark.
- Right-click on ADB.
- Click on "Update Driver Software".
- Click on "Browse my computer for driver software".
- Click on "Let me pick from a list of device drivers on my computer".
- Click on "Have Disk".
- Click on "Browse".
- Navigate to "C:\android-sdk-windows\extras\google\usb_driver" and select "android_winusb.inf".
- Click on "Android ADB Interface".
- NOTE: You will get an Update Driver Warning, click on "Yes".
- Once finished installing the driver, open the command prompt on the computer, and type in the following command to sure everything is setup properly:
adb devices
- If it lists any devices, everything is fine and you are finished. If not, you may have further issues and will have to do further research on your own.
source : http://wiki.cyanogenmod.com/wiki/Howto:_Install_the_Android_SDK