Thursday, December 8, 2011

How to install and set up the Android SDK

Android SDK and AVD Manager
The Android SDK (Software Developer's Kit) is a software suite intended for developing software for Android devices. The SDK, however, is not only useful for developers; it provides an easy way to access your device from a computer, and makes simple tasks such as installing applications that much simpler. In addition, it can also be used for more complex Android firmware development tasks. 
To use the Android SDK, you need to install it to your computer. Below, we outline the necessary steps to install the SDK to your Linux, Mac OS-X or Windows PC.

Before you begin:

- Ensure you have the Java Development Kit (JDK)
- and that your computer meets the minimum system requirements

Download the SDK Starter Package

The Starter Package downloads the basic SDK tools necessary to download the rest of the SDK. Download it HERE.

Download Other Components

Windows: Double-click the SDK Manager.exe file at the root of the SDKdirectory
Mac/Linux: Open a terminal and navigate to the /tools directory in the SDK then execute:
./android 
By default, there are two repositories of components for your SDK 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 /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 /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

Windows

1. Download the latest Android SDK.
2. Unzip the package to the root of C:\ or run the executable.
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 4". 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.
a. Click on"Available Packages" on the left.
     b. Expand "Third party Add-ons".
     c. Expand "Google Inc. add-ons".
     d. Check "Google USB Driver package, revision 4".
     e. 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 in 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.
     a. Right-click on My Computer (Windows XP) or Computer (Windows Vista/7).
     b. Click on Manage.
     c. 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\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.

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
That's it - you're all done!

No comments:

Post a Comment

thank you