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







pCloud Premium

  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. On your phone, click Settings > Applications > Development and make sure USB 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.
  5. 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
  6. You should be ready to go, type in a new terminal window adb devices with your phone plugged in.
  7. 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
  8. 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
    
    • To fix it, install glibc.i686
    • 1-glibc-png

    • 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
      
    • …you need to install libstdc++
    • 2-libstdc-png

    • 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
    • screenshot_2013-08-13-20-23-53-png

  9. In your terminal you will get the following
  10. esausilva@localhost ~$ adb devices
    List of devices attached 
    0A3C260D0F00700F	device
    

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 🙂





Esau Silva
Software Engineer at Region One ESC
Microsoft Full Stack Application Developer
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed.
Share