How to set up Android SDK in Linux

Did you find this thread helpful

  • Yes

    Votes: 2 100.0%
  • No

    Votes: 0 0.0%
  • Other

    Votes: 0 0.0%

  • Total voters
    2
Search This thread

ehth77

Member
Oct 17, 2013
5
1
*If you find this Guide Thread helpful, feel free to hit the "thanks" button below!:D

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://xdaforums.com/showthread.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. ;):good:

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.:angel:

PM me or post here if you have any doubts. :victory:
 
Last edited:
  • Like
Reactions: adm_ia

Pirateghost

Inactive Recognized Developer
Jul 24, 2010
11,696
8,703
androidninjas.com
Install an aur wrapper like pacaur .

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

Done

Sent from my Nexus 5
 

Pirateghost

Inactive Recognized Developer
Jul 24, 2010
11,696
8,703
androidninjas.com
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
 
  • Like
Reactions: ehth77

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    *If you find this Guide Thread helpful, feel free to hit the "thanks" button below!:D

    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://xdaforums.com/showthread.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. ;):good:

    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.:angel:

    PM me or post here if you have any doubts. :victory:
    1
    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