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
Download the latest Android SDK from Google: Android SDKExtract the TGZ file to your home/YOUR-USERNAME directoryTo get ADB, you need to install the SDK: Installing the SDKIf 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
- Download the SDK Platform Tools for Linux and extract the zip file.
- 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.
- 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
- Open a terminal window in your home (~) directory and type: sudo vi .bashrc (or
- You should be ready to go, type in a new terminal window
adb devices
with your phone plugged in. - 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
- To fix it, install glibc.i686
- 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++
- 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
- 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]
Edgar Segura liked this on Facebook.
step three needs to be …you need to install libstdc++.i686
Very good article on getting the physical phone devices detectable.
Thank you! Your guid help me with my problem =)
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)