android sdk ubuntu,How to install Android SDK in Ubuntu System

拓拔玺
2023-12-01

1. install Java SE and configure envirornment variables

get the Java SE from here: http://java.sun.com/javase/downloads/index.jsp

then you will get a bin file named with "jdk-6u17-linux-i586.bin"

open a shell terminate input command as below:

$ cd /opt/src : tranfer into the directory where store the jdk bin file

$ sudo chmod u+x jdk-6u17-linux-i586.bin : edit the bin's property to make it can be executed

$ ./jdk-6u17-linux-i586.bin : install jdk

mv the jdk directory to where you want to store your own program, here I move it to the /opt/android/, then it will be followed to configure the enviornment variables in shell configuration file. Go to /etc find profile add following sentences in it

"

#Java SE JDK

export JAVA_HOME=/opt/android/jdk1.6.0_17

export CLASSPATH=$CLASSPATH:.$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$PATH:$JAVA_HOME/bin

"

store and quit

till now the jdk has been successfully installed, you may input following command in the shell to vertify it,

$ java -version

the shell will display some jdk information like this:

"

java version "1.6.0_0"

OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)

OpenJDK Server VM (build 14.0-b16, mixed mode)

"

2. Downloadable SDK Components

website: http://developer.android.com/sdk/index.html

choose the Linux (i386) collumn's Package: android-sdk_r04-linux_86.tgz2.

then you will get a tar file : android-sdk_r04-linux_86.tgz, release it with following command:

$ sudo tar xfvz android-sdk_r04-linux_86.tgz

go into the "android-sdk-linux_86"

$ cd android-sdk-linux_86/tools

$ ./android

use the above command to start Android SDK and AVD Manager, select the Available Packages to install the android sdk you want to install, here I selected all. If you have any trouble when connect the website, change to "Settings", in "Misc" group select "Force https://... sources to be fetched using http://", push the "Save and Apply" button, then close the "Android SDK and AVD Manager". Restart it using the same command in the shell,

$ ./android

when setting up the ADT plugin or when using the SDK tools.

Optionally, you may want to add the location of the SDK's primary tools directory to your system PATH. The primary tools/ directory is located at the root of the SDK folder. 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.

* 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}:/tools

here I edit profile in /etc like this:

#Android environment variables

ANDROID_TOOLS=/opt/android/android-sdk-linux/tools

export PATH=$ANDROID_TOOLS:$PATH

input "adb" in a new shell to vertity whether the enviornment variables has affected.

when you get some adb information it means you have succeeded.

$ adb

"

Android Debug Bridge version 1.0.25 ...

"

3. Finally install the ADT plugin into the Eclipse

Install the ADT Plugin for Eclipse

Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT), that is designed to give you a powerful, integrated environment in which to build Android applications. It extends the capabilites of Eclipse to let you quickly set up new Android projects, create an application UI, add components based on the Android Framework API, debug your applications using the Android SDK tools, and even export signed (or unsigned) APKs in order to distribute your application.

make sure that you have a suitable version of Eclipse installed on your computer (3.4 or newer is recommended). If you need to install Eclipse, you can download it from this location:

http://www.eclipse.org/downloads/

here I choose Eclipse 3.5 (Galileo) for example:

# Start Eclipse, then select Help > Install New Softare.

# In the Available Software dialog, click Add...

# In the Add Site dialog that appears, enter a name for the remote site (for example, "Android Plugin") in the "Name" field.

In the "Location" field, enter this URL: https://dl-ssl.google.com/android/eclipse/

If you have trouble aqcuiring the plugin, you can try using "http" in the URL, instead of "https" (https is preferred for security reasons). Click OK.

# Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.

# In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.

# Restart Eclipse.

Now modify your Eclipse preferences to point to the Android SDK directory:

# Select Window > Preferences... to open the Preferences panel

# Select Android from the left panel

# For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory

# Click Apply, then OK.

Done! If you haven't encountered any problems, then you're ready to begin developing Android applications.

Troubleshooting ADT Installation

If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:

If Eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use http, rather than https. That is, set the Location for the remote site to: http://dl-ssl.google.com/android/eclipse/

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 OS X, Eclipse) > Preferences > General > Network Connections.

If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT zip file to your local machine and manually install it:

1. Download the current ADT Plugin zip file from here: http://dl.google.com/android/ADT-0.9.5.zip (don't unpack it)

2. Follow steps 1 and 2 of "here I choose Eclipse 3.5 (Galileo) for example:" (above)

3. In the Add Site dialog, click Archive.

4. Browse and select the downloaded zip file.

5. In Eclipse 3.5 only, enter a name for the local update site (e.g., "Android Plugin") in the "Name" field.

6. Click OK.

7. Follow the remaining procedures as listed for "here I choose Eclipse 3.5 (Galileo) for example:" (above)

If you still cannot install ADT plugin and encounter the error message like this:

"

Cannot complete the install because one or more required items could

> not be found.

>   Software

being installed: Android Development Tools

> 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group

> 0.9.5.v200911191123-20404)

>   Missing requirement: Android Development Tools

> 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group

> 0.9.5.v200911191123-20404) requires 'org.eclipse.wst.xml.ui 0.0.0' but

> it could not be found

"

there may be miss some plugins in your eclipse

1. Go to "Help/Install New Software...

2. Add http://download.eclipse.org/releases/galileo/ to the update sites list(strange it's not installed by default on ubuntu)

3. From there, install WST (use the filter box to find the package)

4. Restart eclipse

5. Go back to "Help/Install New Software..." and install the Android ADT as explained on the android website.

OK, till here you may have a breath, an Android SDK with Eclipse IDE has been successfully installed in you Ubuntu system.

Congratulation!!!

Summarized by Benjamin Qi

Intern of Beijing PalmCity Science and Technology Co., Ltd

MSN: benjaminqi@hotmail.com

2009/12/13 pm

 类似资料:

相关阅读

相关文章

相关问答