Setting Up ADB/USB Drivers for Android Devices in Linux (Fedora)

I have been using Linux Fedora for a couple of month and decided that it was time to set it up for Android. I was expecting it to be something like what I did for Ubuntu (Setting Up ADB/USB Drivers for Android Devices in Linux Ubuntu), but it was much easier in Fedora. Just had to install two utilities and that was it. This was tested in Fedora 18 Spherical Cow and Fedora 19 Schrödinger’s Cat.

But I do not want to bore you with my story, continue reading for the guide

[topads][/topads]

Update: 06/23/17 – Updated steps in How To

  1. Download the latest Android SDK from Google: Android SDK
  2. Extract the TGZ file to your home/YOUR-USERNAME directory
  3. To get ADB, you need to install the SDK: Installing the SDK
    • If you are not a developer and not planning to develop, then just download the following zip file containing only the ADB tool and proceed with the tutorial: ADB and extract the tar to your home/YOUR-USERNAME directory
  4. Download the SDK Platform Tools for Linux and extract the zip file.
  5. On your phone, click Settings > Developer Options and make sure Android Debugging is on.
    • In Android 4.2.x and up Developer Options is hidden, to make it visible, do the following
    • Tap seven times in Build Number: Settings > About Phone > Build Number
    • You will get a message saying you have enabled Developer Options or something like that, go back to Settings and you will see Developer Options in there.
  6. Once you have done the above, you need to add adb to your PATH as environmental variable.
    • Open a terminal window in your home (~) directory and type: sudo vi .bashrc (or sudo gedit .bashrc if you don’t like vi)
    • Add the following line at the end: export PATH=${PATH}:/home/YOUR-USERNAME/android-sdk-linux_x86/platform-tools
    • Save and close the terminal window
  7. You should be ready to go, type in a new terminal window adb devices with your phone plugged in.
  8. If you are running a 32bit distro, you should be good, but if you are running a 64bit distro, you will get the below error
esausilva@localhost ~$ adb devices
bash: /home/esausilva/Documents/Projects/Android/android-studio/sdk/platform-tools/adb: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
  1. To fix it, install glibc.i686
glibc
glibc
  1. Again type adb devices with your phone plugged in. If you get the below error…
esausilva@localhost ~$ adb devices
adb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
  1. …you need to install libstdc++
libstdc
libstdc
  1. Now you should be ready to go. Again type adb devices with your phone plugged in and you should get the below message in your phone. Check Always allow from this computer and press OK
Allow USB Debugging Window
Allow USB Debugging Window
  1. In your terminal you will get the following
esausilva@localhost ~$ adb devices
List of devices attached
0A3C260D0F00700F device

[signupform][/signupform]

Common ADB Commands

– Lists which devices are currently attached to your computer

adb devices

– Drops you into a basic linux command shell on your phone with no parameters, or lets you run commands directly

adb shell

– Lets you install an Android application on your phone

adb install

– Remounts your system in write mode – this lets you alter system files on your phone using ADB

adb remount

– Rets you upload files to your phones filesystem

adb push

– Lets you download files off your phones filesystem

adb pull

– Starts dumping debugging information from your handset to the console – useful for debugging your apps

adb logcat

If you liked this tutorial, please retweet and/or share 🙂

[bottomads][/bottomads]

Spread the love

5 thoughts on “Setting Up ADB/USB Drivers for Android Devices in Linux (Fedora)

  1. me says:

    step three needs to be …you need to install libstdc++.i686

  2. KISHOR K P says:

    Very good article on getting the physical phone devices detectable.

  3. twitter_S_Nadolskiy says:

    Thank you! Your guid help me with my problem =)

  4. Andres says:

    Thank you! In Fedora 23, I also had to install ncurses-libs.i686

    (Otherwise I had the error adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory)

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.