Google+

Wednesday, July 27, 2011

How to Install Android SDK

 General Instructions

Prepare your Computer

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).

(Optional) Install ADT Plug-in for Eclipse

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

  1. emerge dev-util/android-sdk-update-manager
  2. run /opt/android-sdk-update-manager/tools/android
  3. install platform-tools package
  4. ADB will be at /opt/android-sdk-update-manager/platform-tools/adb
  5. Edit your .bashrc file and add this line:
    export PATH="/opt/android-sdk-update-manager/platform-tools/:${PATH}"

Ubuntu Linux

  1. Follow the General Instructions above.
  2. Setup udev.

Mac OS X

Installing the Android SDK

  1. Download the latest version of the Android SDK
  2. Unzip it and move it where needed
    unzip Downloads/android-sdk_r09-mac_86.zip -d~/bin

  3. Open Terminal.app (in /Applications/Utilities)

  4. Edit ~/.profile and append
    export PATH=~/bin/android-sdk_r09-mac_86/platform-tools:~/bin/android-sdk_r09-mac_86/tools:$PATH

  5. Load new .profile
    source .profile

  6. Run Android SDK Manager
    android

  7. Install Components

Installing Eclipse

  1. Download the latest version of Eclipse (Classic or Java Developers are probably best)
  2. Open Terminal.app (in /Applications/Utilities)
  3. 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 reload source .profile.

  4. Open Eclipse.

  5. Open Preferences, go to Android. Set your SDK location. Click OK.

  6. Go to Help » Install New Software.

  7. Click Add.
    • Name: Google ADT
    • Location: https://dl-ssl.google.com/android/eclipse/

  8. Install pieces that you want.

Windows

  1. Download the latest Android SDK (preferably the zip file not the exe).
  2. Unzip the package to the root of C:\.
    NOTE: This will output a folder called "android-sdk-windows".

  3. Open up the android-sdk-windows folder and launch the SDK Manager.

  4. 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.

  5. Once that is finished, you will need to install the USB drivers included with the Android SDK.
    1. Click on"Available Packages" on the left.
    2. Expand "Third party Add-ons".
    3. Expand "Google Inc. add-ons".
    4. Check "Google USB Driver package, revision 4".
    5. Installed Selected.

  6. Once that's finished installing, you can close the SDK Manager.

  7. Go to the Control Panel, and select the System Properties (Windows XP) or System (Windows Vista/7).

  8. Select the Advanced settings;
    • Windows XP: Click on the Advanced tab.
    • Windows Vista/7: Click on Advanced system settings on the left.

  9. Click on Environment Variables.

  10. Under the "System variable" section, you will look for "Path". Double-click on it.

  11. 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.

  12. On the device, ensure that USB Debugging is enabled (Settings » Applications » Development).

  13. Plug the device into the computer via USB cable. The computer will attempt to install the drivers automatically.

  14. On success, open the command prompt on the computer, and type in the following command to sure everything is setup properly:
    adb devices

  15. If it lists any devices, everything is fine and you are finished. If not, the drivers may not be installed correctly, please continue.

  16. Open the Device Manager.
    1. Right-click on My Computer (Windows XP) or Computer (Windows Vista/7).
    2. Click on Manage.
    3. Click on Device Manager on the left.

  17. You will probably see Unknown Device with ADB listed under it with a yellow exclamation mark.

  18. Right-click on ADB.

  19. Click on "Update Driver Software".

  20. Click on "Browse my computer for driver software".

  21. Click on "Let me pick from a list of device drivers on my computer".

  22. Click on "Have Disk".

  23. Click on "Browse".

  24. Navigate to "C:\android-sdk-windows\extras\google\usb_driver" and select "android_winusb.inf".

  25. Click on "Android ADB Interface".
    NOTE: You will get an Update Driver Warning, click on "Yes".

  26. 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

  27. 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

No comments:

Google+