View Poll Results: Did you find this thread helpful
Yes 2 100.00%
No 0 0%
Other 0 0%
Voters: 2. You may not vote on this poll

Post Reply

How to set up Android SDK in Linux

OP ehth77

23rd April 2014, 06:51 PM   |  #1  
ehth77's Avatar
OP Junior Member
Thanks Meter: 1
 
3 posts
Join Date:Joined: Oct 2013
More
*If you find this Guide Thread helpful, feel free to hit the "thanks" button below!

I'm doing this guide because when I switched to arch linux ,I found no guides to setup sdk in it.Arch is a beautiful OS, but for newcomers like me ,I took some time to get used to it.So,In this guide, we’ll take a look at how to set up a development environment for Android in Arch linux(or Arch based Linux Distros) so you can start working on your Projects.Most of the Arch Linux are pro linux users so there is really no need of this guide, but this guide is meant for those who are switching from ubuntu/mint/fedora/any other disto which are not based on Arch, to say it in short its meant for new users of Arch Linux. Anyway Let's set up.

First let's set see how to install Platform tools.


Setting up platform-tools in UBUNTU(or Ubuntu based distros/Linux Mint)
In ubuntu platform tools can be setup very easily.
1.Open terminal(Default shortcut is ctrl+alt+T)
2. Type "sudo apt-get install android-tools-adb" (this will install the adb)
3. Type "sudo apt-get install android-tools-fastboot"(this will install the fastboot)
Step 4: Check whether the above tools are working by typing an adb command. For e.g. "adb devices"


Now its time to install SDK in Ubuntu and set it up but before that let me tell you there is already a great thread by matt95.You can see the guide and thank him herehttp://forum.xda-developers.com/show....php?t=2302780


Fedora/CentOS/RedHat
First lets install Eclipse[You can also use Android Studio if you want]
Code:
sudo yum install eclipse-jdt
Now lets download the sdk from here. http://developer.android.com/sdk/index.html. Its about 500mb , Just wait and let it downlaod. Once the download is done extract it wherever you want.
For newcomers I recommend to extract it to 'home'.So the file is now extracted inside /home/user/AndroidSDK .

Now lets setup .bash_profile file so that we can access adb anywhere or else you have to type the whole location again use the adb command which is lot of work . So let's shorten it up.
Type "sudo vim .bash_profile"in terminal.
Code:
   
   PATH=$PATH:$HOME/AndroidSDK:$HOME/AndroidSDK/tools
   export PATH

    # For SDK version r_08 and higher, also add this for adb:
    PATH=$PATH:$HOME/AndroidSDK/platform-tools
    export PATH
Now lets install android plugin for eclipse.
Open Eclipse and click on Help.Select Install New Software. Then click Add, at the top right of that window. Type in Android Plugin for the name and https://dl-ssl.google.com/android/eclipse/ for the address.

Once this is done, click on the Available Software Sites hyperlink below the Add button, then highlight the Android Plugin source and click on Reload. Now exit this window, and choose Android Plugin from the “Work with” dropdown menu. Choose the developer tools option that you see here and Proceed with the installation.
After the installation configure your Android virtual devices.




ARCH LINUX(or Arch based Distros)
Lets install android sdk
Open terminal and type
Code:
wget https://aur.archlinux.org/packages/an/android-sdk/android-sdk.tar.gz
Note:- If terminal shows wget is not found. Type this in the terminal
Code:
pacman -Suy && pacman -S wget


Once it fetches the tarball, lets extract it by typing
Code:
tar -xvzf android-sdk.tar.gz
wait for it to finish. Change the directory to android-sdk by using the command
Code:
cd android-sdk
.
Now lets make the package by using the command
Code:
makepkg -s
now lets install it by typing
Code:
sudo pacman -U *.pkg.tar.xz
Platform tools for Arch
Let's install platform-tools now.Just like above steps ,well get a package and install it.
1. Type
Code:
wget https://aur.archlinux.org/packages/an/android-sdk-platform-tools/android-sdk-platform-tools.tar.gz
2.Type
Code:
 tar -xvzf android-sdk-platform-tools.tar.gz
3.Change directory.
Code:
cd android-sdk-platform-tools
4.
Code:
makepkg -s
5.Install it
Code:
sudo pacman -U *.pkg.tar.xz
All the files are installed in /opt/android-sdk/ . Just like we had .bash_profile in FEDORA, we use symbolic links in Arch linux to use commands from anywhere .

Code:
sudo ln -s /opt/android-sdk/platform-tools/adb /usr/bin/adb            //this one's for adb
sudo ln -s /opt/android-sdk/platform-tools/fastboot /usr/bin/fastboot           //This one's for Fastboot
sudo ln -s /opt/android-sdk/tools/ddms /usr/bin/ddms                                  //This is for DDMS
sudo ln -s /opt/android-sdk/tools/android /usr/bin/android                          //This is for Android
Now run android by typing "android" in terminal.

Simple as that. If you are yet to switch to Arch linux then I recommened you to use "BBQLinux " its an Arch linux for Android developers. It comes with most of the things needed for android development. You can download it from Here.

Thanks for reading this. Help me by giving me e-books.

PM me or post here if you have any doubts.
Last edited by ehth77; 23rd April 2014 at 07:06 PM. Reason: Color not visible
The Following User Says Thank You to ehth77 For This Useful Post: [ View ]
23rd April 2014, 10:39 PM   |  #2  
Pirateghost's Avatar
Recognized Developer
Thanks Meter: 7,890
 
10,863 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Install an aur wrapper like pacaur .

pacaur -S android-sdk android-studio android-udev android-platform-tools

Done

Sent from my Nexus 5
24th April 2014, 01:30 AM   |  #3  
ehth77's Avatar
OP Junior Member
Thanks Meter: 1
 
3 posts
Join Date:Joined: Oct 2013
More
Talking
Quote:
Originally Posted by Pirateghost

Install an aur wrapper like pacaur .

pacaur -S android-sdk android-studio android-udev android-platform-tools

Done

Sent from my Nexus 5


Thanks for the reply, I havent tried pacaur repository though. Will give it a try soon.
24th April 2014, 02:07 AM   |  #4  
Pirateghost's Avatar
Recognized Developer
Thanks Meter: 7,890
 
10,863 posts
Join Date:Joined: Jul 2010
Donate to Me
More
sorry, I made an error:

Code:
pacaur -S android-sdk android-sdk-platform-tools android-udev android-studio android-sdk-build-tools
you dont need both platform and build tools, it looks like build-tools is more recent. if you want eclipse instead of android studio, just use 'eclipse-android' instead of android-studio
The Following User Says Thank You to Pirateghost For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Nexus 7 General by ThreadRank