Download and Install AndroidSDK in Ubuntu 12.04 (Precise Pangolin) 30


Android SDK is a development environment for the Android mobile operating system which allows you to write applications for Android devices or gain elevated privileges on android devices with the help of third party software.

This brief tutorial is going to show you how to download and install it in Ubuntu 12.04 if you haven’t already done so. To install it, you first need to install Java JDK package or use the openJDK Java alternative that comes with Ubuntu.

In this tutorial, I’m going to be using the openJDK version of Java. To install Oracle Java version, then read this post first.

Objectives:

  • Install AndroidSDK in Ubuntu 12.04 (Precise Pangolin)
  • Enjoy!

 

To get started, press Ctrl – Alt – T on your keyboard to open the terminal. When it opens, run the commands below to install OpenJDK.

sudo apt-get install openjdk-6-jre openjdk-6-jdk icedtea6-plugin

 

android_precise

 

Next, download AndroidSDK package by running the commands below. At the time of this writing, the current version was r20. Or click this link to download the .tgz archive file.

wget http://dl.google.com/android/android-sdk_r20-linux.tgz

 

android_precise_1

 

After downloading, run the commands below to extract the downloaded file.

tar -xvzf android-sdk_r20-linux.tgz

 

android_precise_2

 

After extracting the package, run the command below to change into the tools directory.

cd ~/android-sdk-linux/tools

 

android_precise_3

 

Finally, run the commands below to begin the installation.

./android

 

android_precise_4

 

Install Android updates if there are any available.

 

android_precise_5

 

After updating, run the commands below to include AndroidSDK in your path environment.

gedit ~/.bashrc

 

Then add these lines at the very top of the file and save it.

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

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

 

android_precise_6

 

 

Log out and log back in, then type android on the command line to launch the software.

android avd

 

Build your own phone.

 

android_precise_7


Please share if you like it on:



Leave a Comment

Your email address will not be published. Required fields are marked *

30 thoughts on “Download and Install AndroidSDK in Ubuntu 12.04 (Precise Pangolin)

  • sam

    I have same problem! I checked the $PATH, file locations looks fine. My version is 4.2. But still when I run android or go to the actual directory and run ./android it still brings up the sdk manager!! any solution?

    • Randomguy

      did you setup your usb rules? ( /etc/udev/rules.d/51-android.rules )

      use this format:

      SUBSYSTEM==”usb”, ATTR{idVendor}==”xxxx”, ATTR{idProduct}==”xxxx”, MODE=”0600″, OWNER=””

      Vendor and product ID can be obtained by using lsusb and searching for your device. (Note: The device actually is a Galaxy Nexus.)

      $ lsusb | grep -i samsung
      Bus 002 Device 103: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II]

      The udev rule looks like this:

      # adb protocol on maguro/toro (Galaxy Nexus)
      SUBSYSTEM==”usb”, ATTR{idVendor}==”04e8″, ATTR{idProduct}==”6860″, MODE=”0600″, OWNER=”username”

      To let the changes take effect reboot.

  • Chandan

    After installation when I am giving the command “android avd”, it shows message “android: command not found”.

    Can anyone suggest me why is it happening.

    Thanks & Regards

  • RIADH

    while starting the emulator doesn’t start the message desplayed “cannot run …/android/tool/emulator
    io.IOexception
    what can i do ?

  • JACK6911

    I’ve an issue here…
    [code]

    Starting emulator for AVD 'test'
    Failed to start emulator: Cannot run program "/home/user/android-sdk-linux/tools/emulator": java.io.IOException: error=2, No such file or directory

    [/code]

  • agriyanto dwi

    i wrote ./android avd in terminal.. and the AVD does’nt work and i found like this

    java.awt.HeadlessException
    at sun.awt.HeadlessToolkit.getScreenResolution(HeadlessToolkit.java:221)
    at com.android.sdkuilib.internal.widgets.AvdStartDialog.getMonitorDpi(AvdStartDialog.java:441)
    at com.android.sdkuilib.internal.widgets.AvdStartDialog.createDialogContent(AvdStartDialog.java:189)
    at com.android.sdkuilib.ui.GridDialog.createDialogArea(GridDialog.java:76)
    at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at com.android.sdkuilib.internal.widgets.AvdSelector.onStart(AvdSelector.java:1105)
    at com.android.sdkuilib.internal.widgets.AvdSelector.access$600(AvdSelector.java:84)
    at com.android.sdkuilib.internal.widgets.AvdSelector$7.widgetSelected(AvdSelector.java:331)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1.open(AvdManagerWindowImpl1.java:144)
    at com.android.sdkuilib.repository.AvdManagerWindow.open(AvdManagerWindow.java:94)
    at com.android.sdkmanager.Main.showAvdManagerWindow(Main.java:381)
    at com.android.sdkmanager.Main.doAction(Main.java:323)
    at com.android.sdkmanager.Main.run(Main.java:120)
    at com.android.sdkmanager.Main.main(Main.java:103)

    can you fix it ? thanks :)

  • asficom

    please help me out, i can’t install the 2packages on my ANDROID SDK MANAGER, it keeps showing this (package Google APIs, Android AP 19, revision 1′ Depends on MISSING SDK PLATFORM ANDROID, API 19)

  • naiian

    done everything as described on the page ,typing android avd in terminal the android virtual device manager responded with no AVD available..what went wrong ? any help please (I did log out and back in as told)

  • chiwe david

    thanks for your last tutorial on how to install bitdefender on ubuntu machine, it worked correctly, infact your tutorials always works correctly without stress,
    now about the android sdk.
    i just got stucked in in the android sdk manager.
    atfer sellcting the ACCEPT ALL option the install botton wouldn’t activate, why please i your help, reply me, i appreciate you for your ability to teach peaple in the way that they perfectly understand. thats an ABILITY.

  • malay

    android avd is running but not able to detect any device.

    in tne directory /etc/udev/rules.d/ this 51-android.rules ia not present..