What all needs to be done to install Android SDK / ADT Bundle on Ubuntu?
Each of the steps in the answer was found on some different forum as I encountered obstacles getting started with my Android SDK and posted questions in appropriate forums thereafter. So I thought this would be useful in that it is a one stop solution available, in case one ever needs to re-install Ubuntu and install the Android SDK / ADT Bundle from scratch!
Actually, I think you should use Android Studio to develop android application. However, if you have your reason to use eclipse, you can follow the following guide.
1. Installing Java Runtime (JDK) and Eclipse IDE
Search
Software
on Ubuntu and launchUbuntu Software Center
Search
Java
onUbuntu Software Center
and then install theOpenJDK Java Runtime
.Search
Eclipse
onUbuntu Software Center
and then install it.If you have successfully installed eclipse and JDK, it will appear in the search result on your computer.
For the JDK, you can also press CTRL + ALT + T to open a terminal and type command
java -version
to check again.Tips : Lock the eclipse icon on launcher.
2. Downloading SDK
Go to http://developer.android.com/sdk/index.html to download the latest version of SDK.
Scroll down and click
DOWNLOAD FROM OTHER PLATFORMS
Click
android-sdk_r22.6.2-linux.tgz
underLinux 32 & 64-bit
ofSDK Tools Only
.Tick
I have read and agree with the above terms and conditions
and clickDownload android-sdk_r22.6.2-linux.tgz
.Wait for the download process.
3. Preparing for Installation
Rigth click the file[.tgz] and select
Extract Here
.Now you can see that a file called
android-sdk-linux
appears as if the following.Enter the folder
android-sdk-linux
.Enter the folder
tools
and then copy the folder location.Press the keys CTRL + ALT + T to open a terminal and then use the following command. Where
/home/casper/Downloads/android-sdk-linux/tools
is the location I copied previously. You can just typecd
and right click to past the location to the terminal.Now the
Android SDK Manager
will be run.4. Installing Packages
Click Install [Number] packages....
Click
Accept License
and then click Install.Wait for the installation process.
Finally, this message will be shown.
5. Editing ".bashrc"
Press CTRL + ALT + T to open a new terminal and type :
gedit ~/.bashrc
Now the following text will appear.
Add the following to the top of the entire text and then save it. (Do not close the file)
Example :
[Recommended] Move the whole file
android-sdk-linux
to your eclipse's workspace and under a folder that you create namedAndroid
. Moreover, you have to copy the location.Now back to the ".bashrc" file and the replace the '~' with the location you copied previously and then save it and close it.
Logout and relogin your Ubuntu system.
6. Setting Up an Android Virtual Device
Press CTRL + ALT + T and type
android avd
to open the Android Virtual Device Manager.Click New.... Set up like the following and click OK.
Click your virtual device and then click Start....
Click Launch.
Launching your virtual device
7. Installing ADT Plugin on Eclipse
Start Eclipse and go to Help -> Install New Software...
Click Add....
Type the following and then click OK.
Tick the checkbox of
Developer Tools
and then click Next>.Click Next>.
Click "I accept the..." and click Finish.
Wait for the installation process.
Restart eclipse.
Click Open Preferences.
Copy your own SDK location (The location of the file
android-sdk-linux
).Paste to the
SDK Location:
textbox and then click Apply and OK.Enjoy to create any android application with your Ubuntu.
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
This may seem to be a long answer, but I tried to explain every step as detailed as possible so nothing can go wrong. You can set this up in less than 5 minutes, even as a beginner.
You'll need Java to use Eclipse, so install it first:
Eclipse is an IDE. The Android ADT package is being bundled with the Eclipse IDE by default. You can also choose to use another IDE (for example NetBeans) if you prefer, but because Eclipse is the default I'll cover only Eclipse in this tutorial.
Open a terminal
Search for it in your Dash or press CTRL + ALT + T
Execute the following commands:
Check if you see any errors on your screen, then continue.
Now download the Android ADT bundle (this is Eclipse + the Android SDK):
Download the SDK (ADT Bundle for Linux)
I have read and agree with the above terms and conditions
Select your architecture:
How can I check this?
32-bit
if you've a 32-bit Ubuntu64-bit
if you've a 64-bit UbuntuDownload the SDK ADT Bundle for Linux
Install the Android ADT bundle:
.zip
file you've just downloadedExtract all files to a directory, for example:
After extraction this directory should contain 2 other directories:
Add the
platform-tools
binaries to your$PATH
:This is not neccesary, it'll make commands like
adb
accesible from a terminal.Execute the following command:
Add the following line on top:
Save the file
You can do this by pressing CTRL + X, Y, ENTER
Create a shortcut in your Dash to easily launch the ADT:
Execute the following command
Paste this:
This can be done by right cliking inside your terminal window and then click
Paste
.Note: Replace
username
by your username. You can get your username by executingwhoami
in a terminal.Execute the following command to make it executable:
If you've done everything right you've now succesfully installed the Android ADT. Open your Dash and search for
ADT
. Click onAndroid ADT
to check if it's working!You can also install
adt
andandroid-sdk
from this PPA.To complete the installation of
android-sdk
you need to:You can also install
android-studio
:Now check that the installation went as expected:
There is another alternative. Integrated Development Environments (IDEs) are supposed to make programming easier, one problem with them however is that it can be difficult to install the latest version of an IDE on a Linux system (Ubuntu) if they are not in the repos. Android Studio is one such IDE.
Extracted from: http://developer.android.com/tools/studio/index.html
Follow this procedure:
Leave the installation path as the default value;
Press enter again. You will have to agree to the license by typing ‘a’ then download starts.
Android Studio will then present you with a wizard, just keep hitting next and agree to the license. It will then proceed to download requirements for Android development, such as the latest Android SDK. Click on ‘Finish’ once the installation of required packages is complete.
CLI approach
Tested on Ubuntu 15.10, Android 22.
One the device:
Then:
Add to your
~/.profile
: TODO: which of those are actually necessary?Logout and login. You may need:
Test the installation
Get your hands on a minimal project like this one or look under
$ANDROID_SDK/samples/
.If it is an Ant project (contains a
build.xml
file) run:If it is a Gradle project (contains a
gradlew
file) run:The app should be installed on your device.
Studio (ADT successor) can be launched with:
NDK samples can be found under
$ANDROID_NDK/samples
and you can build and install them with:State of official Debian packages
There is currently no official Debian package.
But there is a Google Summer of Code 2015 project trying to solve that: https://www.google-melange.com/gsoc/project/details/google/gsoc2015/seamlik/5707702298738688