Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
    
Just vote it as a dupe :) –  Lucio May 15 at 15:03
    
What's a "Android Development Environment"? –  Braiam May 15 at 15:23
1  
i preffer this question than the original one, better answered imho. –  riccivr May 15 at 15:53
    
Apparently it's easier for some people to rant than to just answer the question. So, here's the answer; webupd8.org/2012/09/… & webupd8.org/2014/05/… –  C.Jacobs May 15 at 18:49

5 Answers 5

up vote 58 down vote accepted

Step 1

Check in System Settings -> Details, whether your Ubuntu is 32-bit or 64-bit


Step 2

(Using software centre or command lines) If your Ubuntu is a 32-bit OS then install libgl1-mesa-dev

In case of 64-bit OS install ia32-libs (Ubuntu 13.04 or earlier), or libgl1-mesa-dev:i386 (Ubuntu 13.10 and above)


Step 3

Install openjdk-6-jdk or better, openjdk-7-jdk


Step 4

Download the Android SDK or the ADT Bundle from here and unzip it to wherever you want.


Step 5

Check that the unzipped ADT Bundle folder (or Android SDK folder, as the case may be) have the folders tools and platform-tools. These folders contain some important commands stored. Add them to your executable path. Adding them to the path can be done as follows:

First execute gedit ~/.pam_environment. A file opens. Just add these lines to that file:

   `PATH DEFAULT=${PATH}:/path/to/tools`
   `PATH DEFAULT=${PATH}:/path/to/platform-tools`

Here you have to replace /path/to/tools and /path/to/platform-tools by the absolute paths according to where you unzipped the SDK or the ADT bundle download. Now all the commands adb, android, emulator etc can be simply executed in the terminal without giving absolute paths. That is, you will not get a "command not found" error if you gave it without its absolute path.

share|improve this answer
3  
Why would you need to modify GRUB configuration??? –  Marius Gedminas Oct 7 '13 at 15:19
1  
Very helpful and well written. +1 cause I had to use this previously on Windows and wanted to move yet another thing to Ubuntu. –  RPi_Awesomeness Oct 15 '13 at 0:07
1  
@Aneesh better to put your parameters to ~/.pam_environment instead of ~/.bashrc. Session-wide environment variables –  nazar_art Dec 8 '13 at 11:43
1  
As the .pam_environment file is in the home directory, hence owned by the user, why does ... .pam_environment need to be run with the sudo command? –  Wilf Jan 9 at 22:46
5  
Really, better to add PATH="$PATH:/path/to/tools:/path/to/platform/tools" to your .profile. .pam_environment is overwritten if you change language configuration... –  Rmano Mar 6 at 14:54
Target : Super Newbies
IDE    : Eclipse

1. Installing Java Runtime (JDK) and Eclipse IDE

  • Search Software on Ubuntu and launch Ubuntu Software Center

    Searching

  • Search Java on Ubuntu Software Center and then install the OpenJDK Java Runtime.

    enter image description here

  • Search Eclipse on Ubuntu Software Center and then install it.

    enter image description here

  • If you have successfully installed eclipse and JDK, it will appear in the search result on your computer.

    enter image description here enter image description here

  • For the JDK, you can also press CTRL + ALT + T to open a terminal and type command java -version to check again.

    enter image description here

  • Tips : Lock the eclipse icon on launcher.

    enter image description here


2. Downloading SDK

  • Go to http://developer.android.com/sdk/index.html to download the latest version of SDK. enter image description here

  • Scroll down and click DOWNLOAD FROM OTHER PLATFORMS enter image description here

  • Click android-sdk_r22.6.2-linux.tgz under Linux 32 & 64-bit of SDK Tools Only.

    enter image description here

  • Tick I have read and agree with the above terms and conditions and click Download android-sdk_r22.6.2-linux.tgz.

    enter image description here

  • Wait for the download process.

    enter image description here


3. Preparing for Installation

  • Go to the location where you set to download the file.
  • Rigth click the file[.tgz] and select Extract Here.

    enter image description here

  • Now you can see that a file called android-sdk-linux appears as if the following.

    enter image description here

  • Enter the folder android-sdk-linux.

    enter image description here

  • Enter the folder tools and then copy the folder location.

    enter image description here

  • 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 type cd and right click to past the location to the terminal.

        cd /home/casper/Downloads/android-sdk-linux/tools
        ./android
    

    enter image description here

  • Now the Android SDK Manager will be run.


4. Installing Packages

  • Click Install [Number] packages....

    enter image description here

  • Click Accept License and then click Install.

    enter image description here

  • Wait for the installation process.

    enter image description here

  • Finally, this message will be shown.

    enter image description here


5. Editing ".bashrc"

  • Press CTRL + ALT + T to open a new terminal and type : gedit ~/.bashrc

    enter image description here

  • Now the following text will appear.

    enter image description here

  • Add the following to the top of the entire text and then save it. (Do not close the file)

        export PATH=${PATH}:~/android-sdk-linux/tools
        export PATH=${PATH}:~/android-sdk-linux/platform-tools
    
  • Example :

    enter image description here

  • [Recommended] Move the whole file android-sdk-linux to your eclipse's workspace and under a folder that you create named Android. Moreover, you have to copy the location.

    enter image description here

  • Now back to the ".bashrc" file and the replace the '~' with the location you copied previously and then save it and close it.

    enter image description here

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

    enter image description here

    enter image description here

  • Click New.... Set up like the following and click OK.

    enter image description here

  • Click your virtual device and then click Start....

    enter image description here

  • Click Launch.

    enter image description here

  • Launching your virtual device enter image description here


7. Installing ADT Plugin on Eclipse

  • Start Eclipse and go to Help -> Install New Software...

    enter image description here

  • Click Add....

    enter image description here

  • Type the following and then click OK.

     Name     :    ADT Plugin
     Location :    https://dl-ssl.google.com/android/eclipse/
    

    enter image description here

  • Tick the checkbox of Developer Tools and then click Next>.

    enter image description here

  • Click Next>.

    enter image description here

  • Click "I accept the..." and click Finish.

    enter image description here

  • Wait for the installation process.

    enter image description here

  • Restart eclipse.

    enter image description here

  • Click Open Preferences.

    enter image description here

  • Copy your own SDK location (The location of the file android-sdk-linux).

    enter image description here

  • Paste to the SDK Location: textbox and then click Apply and OK.

    enter image description here

  • Enjoy to create any android application with your Ubuntu.

    enter image description here

share|improve this answer
    
Looks like a nice tutorial, however I would personally just install openjdk-7-jdk, download the ADT (Eclipse including the SDK from android.com) and create a shortcut in the Dash. This way you also have the latest version of Eclipse. –  Louis Matthijssen May 15 at 10:11
    
I just want to provide the easiest way with screenshots for super newbies to set up the environment. I will try you method and post it below =]. –  Casper Li May 15 at 10:18
    
Would you mind if I put my method in an answer below? –  Louis Matthijssen May 15 at 10:41
    
Good!! Maybe I can help you add some screenshots –  Casper Li May 15 at 10:42
    
Why do I need to install Eclipse? What if I don't like eclipse? What if I don't have Java installed? Why too many screenshots? –  Braiam May 15 at 15:23

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.


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

    1. Open a terminal

      Search for it in your Dash or press CTRL + ALT + T

      Terminal

    2. Execute the following commands:

      sudo apt-get update
      sudo apt-get install openjdk-7-jdk
      

      Check if you see any errors on your screen, then continue.

  2. Now download the Android ADT bundle (this is Eclipse + the Android SDK):

    1. Click here to go to the download page.
    2. Click on Download the SDK (ADT Bundle for Linux)
    3. Check I have read and agree with the above terms and conditions
    4. Select your architecture:

      How can I check this?

      • Check 32-bit if you've a 32-bit Ubuntu
      • Check 64-bit if you've a 64-bit Ubuntu
    5. Click on Download the SDK ADT Bundle for Linux
  3. Install the Android ADT bundle:

    1. Open the .zip file you've just downloaded
    2. Extract all files to a directory, for example:

      ~/ADT
      

      After extraction this directory should contain 2 other directories:

      ~/ADT/eclipse
      ~/ADT/sdk
      
  4. Add the platform-tools binaries to your $PATH:

    This is not neccesary, it'll make commands like adb accesible from a terminal.

    1. Open a terminal
    2. Execute the following command:

      nano ~/.profile
      
    3. Add the following line on top:

      PATH="$HOME/ADT/sdk/platform-tools:$PATH"
      
    4. Save the file

      You can do this by pressing CTRL + X, Y, ENTER

  5. Create a shortcut in your Dash to easily launch the ADT:

    1. Open a terminal
    2. Execute the following command

      nano ~/.local/share/applications/adt.desktop
      
    3. Paste this:

      This can be done by right cliking inside your terminal window and then click Paste.

      [Desktop Entry]
      Version=1.0
      Name=Android ADT
      Comment=Launch the Android ADT
      Exec=/home/username/ADT/eclipse/eclipse
      Icon=/home/username/ADT/eclipse/icon.xpm
      Terminal=false
      Type=Application
      Categories=Development;IDE;
      

      Note: Replace username by your username. You can get your username by executing whoami in a terminal.

    4. Save the file
    5. Execute the following command to make it executable:

      chmod +x ~/.local/share/applications/adt.desktop
      

If you've done everything right you've now succesfully installed the Android ADT. Open your Dash and search for ADT. Click on Android ADT to check if it's working!

share|improve this answer
    
Why do I need eclipse? –  Braiam May 15 at 15:24
    
Nice one, added. –  Louis Matthijssen May 15 at 15:40

I have got an amazing video tutorial on YouTube. It is a small 20 minute video by which anyone (beginners like me) can install Android SDK / ADT Bundle in Ubuntu by following 3 to 4 small steps :)

Twenty Minute Tutorial : Installing The New Android SDK

share|improve this answer

You can also install adt and android-sdk from this PPA.

sudo add-apt-repository ppa:linuxgndu/adt-raring
sudo apt-get update
sudo apt-get install adt android-sdk

To complete the installation of android-sdk you need to:

sudo sh /opt/android-sdk/install-sdk

You can also install android-studio:

sudo apt-get install android-studio

Now check that the installation went as expected:

android-sdk-manager
share|improve this answer

protected by Community May 22 at 18:51

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.