Install android sdk and eclipse in Ubuntu 12.04
By Anatoly Mironov
Download and unpack the Android SDK, move it to your home folder. I prefer to set a point in front of the directory folder to make it be hidden so that my home directoy still looks tidy: .android-sdk-linux
. Then add this to your path:
export PATH=${PATH}:~/.android-sdk-linux/tools:~/.android-sdk-linux/platform-tools
.android-sdk-tools is for running android
command, and .android-sdk-tools/platform-tools is for running adb
command And add it to your .bashrc-file so that this path is loaded automatically when you log on.
echo -e '\\nexport PATH=${PATH}:~/.android-sdk-linux/tools:~/.android-sdk-linux/platform-tools' >> ~/.bashrc
```After that you have to install eclipse (so you even get the latest java development kit jdk).
sudo apt-get install eclipse
```Android people recommend to install in that order. If you install eclipse before adt, you maybe don’t find adt in eclipse, as I did. To solve this, uninstall eclipse and remove the folders ~/.eclipse
and ~/workspace
. Then install eclipse again and add adt to eclipse. Then from command-line rund android
and install all the need packages: In Eclipse install adt.
Ubuntu 64 bit
Android SDK is only available in 32 bit. If your Ubuntu is 64 bit, you have to install an additional package:
sudo apt-get install ia32-libs
Wonder if you have 32 bit or 64 bit Ubuntu, just find out in command line:
dpkg --print-architecture
Debug on your device
Follow the steps for attaching to your android devic on android developers site. To enable debugging on LG, e.g. run this:
sudo echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"' > /etc/udev/rules.d/51-android.rules
sudo chmod a+r /etc/udev/rules.d/51-android.rules
Version control
Just install git and add a new ssh key:
sudo apt-get install git
PhoneGap
Want to have your web apps as native android apps, see the PhoneGap. A real world example could be wikipedia mobile.
Updating the SDK
Edit 2014-01-03: Now when KitKat is available, I have updated the SDK through the command line: [code language=“bash”] android update sdk –no-ui [/code]
Comments from Wordpress.com
Sean - Jun 2, 2012
Very simple and clear instructions, thanks Anatoly B-)
Is it real? I mean right after running ./android command, it shows error downloading packages and no one on the internet got a solution for it. It tried several times but never made it work downloading necessary packages! :(
It is weird. I have heard about this issue after I have installed. But it worked for me directly. I must mention I installed eclipse with apt-get and it was a really clean Ubuntu Precise installation. I’ll leave a message in this comment thread if I found some solution.
are you sure your command is right. “./” part says android executable is in current directory. since its on your path (assuming you followed this tut) just “android” (without quotes ofcourse) is sufficient. or if you didn’t set path and android-sdk is in your home directory ~/android-sdk/platform-tools/android
Good observation! Thank you, I hope Aario solves his problems.
Hmm… no android showing in preferences( What could be the problem. Folowed everything what says in article.
Well, he stands clearly that " it shows error DOWNLOADING packages", so for me it is pretty clear that he is executing the command ./android within the RIGHT directory. Probably it was a transitory connectivity problem, in his point or with Google servers, that I hope he has solved yet four months after… X-D
Dude, thanks for this excelent article but I have been in trouble since to start SDK manager. It says “he AVD manager normally uses the user’s profile directory to store AVD files. However it failed to find the default profile directory. To fix this, please set the environment variable ANDROID_SDK_HOME to a valid path such as “~”. I did just like you said.
Glad you liked it. How dit it then? Does it work now? “To fix this, please set the environment variable ANDROID_SDK_HOME to a valid path such as “~”.” , is this an error you get, or is a tip for this blog post?
SOLVED HERE thanks: http://askubuntu.com/questions/203830/android-sdk-path-error-doesnt-find-home-directory
Hi Theo! Huh, I am glad you found a solution. Thanks for sharing and linking to a solution!
Unfortunately an error. I did the same thing as you described. I am running Kubuntu Maverick
I have the same problem, no android entry showing in preferences
My name is Ronald. Am new here. Am getting a lot of help from this forum.
ch_color_title = “0000CC”;