31

My computer is a Sys76 Lemur running Maverick, and my phone is a Nexus S running stock Gingerbread. I want to set up to use ADB (android debug bridge). I installed the Android SDK per instructions on the SDK website, but ADB doesn't work. Can someone help me with directions that are specific to Ubuntu?

3

6 Answers 6

27

Install adb & fastboot via PPA

You can install from the WebUpd8 PPA which support both 32-bit and 64-bit. Granted you can install directly from google. But I prefer to use PPAs to keep everything up to date.
Works for Ubuntu 11.04, 11.10 and 12.04.

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot

Source: Install ADB And Fastboot Android Tools In Ubuntu Via PPA

Install Android SDK via PPA

If you want to install the SDK which will allow you to update everything you can install via the upubuntu ppa.

So first thing is to add the ppa.

sudo add-apt-repository ppa:upubuntu-com/sdk
sudo apt-get update
sudo apt-get install android-sdk

Only issue at this point is that android-sdk needs to be run as root. Well the link in the menu didn't do much. So I updated the link in the menu, you can also run:

gksu android-sdk

From there you will need to install "Android SDK Platform-Tools" I also recommend updating "Android SDK Tools". You can deselect anything else you don't need.

Now you will need to set your environmental variables.
First you will need to make everything executable.

sudo chmod -R 755 /root/android-sdk-linux

Now to add the variables.

nano ~/.bashrc

Add these lines (at the top)

#AndroidDev PATH
export PATH=${PATH}:/root/android-sdk-linux/tools
export PATH=${PATH}:/root/android-sdk-linux/platform-tools

Source: Install Android SDK Manager (Revision 20) From PPA On Ubuntu 12.04/Linux Mint 13
Source: AndroidSDK - Community Ubuntu Documentation

5
  • It's not needed to compile adb, so installing with the android-sdk it's not from source. Furthermore he tags the question with 10.10, so this answer doesn't work. Great is, that this solution provides a 64 bit version.
    – BuZZ-dEE
    Sep 25, 2012 at 0:19
  • Yeah my bad. Didn't notice that is was for 10.10. But hopefully it will help others. As for the source I meant "source" as google.
    – mywebslave
    Sep 25, 2012 at 1:41
  • Yes, if anyone wants to install it, but in this case the question was how to set up after install.
    – BuZZ-dEE
    Sep 25, 2012 at 1:48
  • 1
    none of this worked for me on 16.04. gksu did nothing other than ask for a password
    – mango
    Jul 1, 2016 at 7:32
  • 1
    nilarimogard/webupd8 don't contain android-tools-* and upubuntu-com/sdk is outdated
    – abumalick
    Jan 5, 2017 at 8:11
22

Ubuntu 14.04+

Since Trusty the android-tools-adb and android-tools-fastboot packages in the Universe repository provide, respectively, adb and fastboot.

To install them:

  • Enable the Universe repository: sudo add-apt-repository universe
  • Update the APT cache: sudo apt-get update

To install adb:

sudo apt-get install android-tools-adb

To install fastboot:

sudo apt-get install android-tools-fastboot
3
  • 2
    What's the difference between the android-tools-adb package and the adb package? Both claim to provide the Android Debug Bridge. Oct 15, 2017 at 0:09
  • 1
    @DanDascalescu apt show android-tools-adb says is a transitional package. AFAIK adb should be used. Sep 24, 2019 at 3:52
  • these are now available in the general repo's?
    – Thufir
    Sep 9, 2020 at 8:29
6

2017-Oct update

You don't need to install any package on Ubuntu 16 to get ADB working. No setup is necessary.

Simply download the official SDK Platform-Tools for Linux from Google and extract adb and fastboot from the zip file.

1
  • 2
    can these now just be installed directly with apt and the standard repo's?
    – Thufir
    Sep 9, 2020 at 8:31
3

I'm only guessing but perhaps you need to make sure Ubuntu is looking in the right place. As it says on the website, make sure you have added the directory that adb is located to your $PATH by adding export PATH=${PATH}:/usr/local/src/android-sdk-linux_x86/tools & export PATH=${PATH}:/usr/local/src/android-sdk-linux_x86/platform-tools to your .bashrc and running source .bashrc

1
  • 2
    It works :o) with one small correction, export PATH=${PATH}:/usr/local/src/android-sdk-linux_x86/platform-tools/
    – bigcat42
    Apr 13, 2011 at 5:55
1

@mywebslave answered it perfectly, I just want to add one more thing to that. If you're running a 64 bit machine and doing an offline install, you may have to install the 32 bit compatibility libraries as mentioned here.

sudo apt-get install ia32-libs

Update: The above command works only if you're running 13.04 and below. For newer versions ia32-libs has been replaced by other packages. See here.

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
1

Pre-requisite: Install the Android SDK

On Linux systems you will find adb and fastboot under ~/Android/Sdk/platform-tools directory. Just add this as bin and you're good to go e.g.

sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb
sudo chmod +x /usr/bin/adb
3
  • 1
    What creates ~/Android/Sdk? That directory doesn't exist on my Ubuntu Linux system. Sep 10, 2020 at 8:07
  • 1
    This is a bad solution, because after adb is updated in ~/Android/Sdk/platform-tools/adb the versions of adb will not match anymore and you will not be able to run adb. It is better to make a symbolic link in /usr/bin/adb instead
    – user502144
    Jan 30, 2021 at 19:05
  • 1
    This is actually a perfect solution if you already have android SDK installed
    – Sheikh
    Apr 10, 2021 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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