Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (Not For Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (Not For Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11th May 2014, 08:36 AM
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Nanjing, China
Posts: 1,332
linuxfirefox
HowTo: set-up adb (Android Debug Bridge) on Fedora 20

There are numerous reports that adb (Android debug bridge) fails to see Android devices attached to a Fedora box via USB. If you encounter this problem, this guide may give you some hints and ideas about how to set-up adb with workarounds.


1. Install adb
This is simple; just pull it from Fedora's repo:
Code:
$ sudo yum install android-tools
The adb package installs a systemd service (adb.service) which is disabled by default. Usually this is not needed, as adb runs fine as a user-owned daemon process automatically when you start it.

2. Enable USB debugging on the device
This may vary from device to device, and this part is not really related to Fedora. Some phones may lack the option of USB debugging at all. Please refer to the device's support material or online resources. On my Nexus 5 phone, this is done by clicking the "Build number" section in "Settings -> About phone" many times, which unlocks the "Developer options" hidden feature, and selects "USB debugging".

3. Determine the USB ID of the Android device
Install `usbutils' if you don't have it yet:
Code:
$ sudo yum install usbutils
Connect the device to a USB port on the Fedora box and check the device ID using `lsusb':
Code:
$ lsusb
The output should include your device, with a record that looks like this:
Code:
Bus 003 Device 002: ID 18d1:4ee2 Google Inc. Nexus 4 (debug)
4. Check the permission on the USB device character special file
Code:
$ ls -l /dev/bus/usb/MMM/NNN
where MMM is the No. of "Bus" from the previous section's `lsusb' output, and NNN is the "Device" number from the same line.

If the device is owned by user root and group root, while lacking group- and other- readwrite permission bits, adb as a user-owned process will not have enough permissions to use the device.

(This is usually the problem encountered by the "adb doesn't work" folk 9 of 10 times.)

If this is the case, only the root user will be able to use adb, but using the root user for anything other than basic system configuration is Considered Harmful™. We need to allow user-access on this device.

5. Create a user group and tell udev to create USB device file for this group
First create a group for normal users who should be allowed to access the device:
Code:
$ sudo groupadd androiddev
Here `androiddev' is used as a group name. Of course you can choose your own name for such a group as long as it has not been taken already.

Then add yourself, and all approved users to the group:
Code:
$ sudo usermod -aG androiddev your_login_name
Here `your_login_name' is your own username. Repeat for other users if necessary.

Now, as root, create the file `/etc/udev/rules.d/99-android-debug.rules` and fill it with the following content:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="AAAA", ATTR{idProduct}=="BBBB", GROUP="androiddev", MODE="0664"
Replace the `AAAA' and `BBBB' strings with the real Vendor:Product IDs of the device, cf. the output of `lsusb' in Section 3.

6. Refresh group enumeration for yourself
Simply log off and log in again, or use this terrible hack (for your current shell session):
Code:
$ exec su -l $USER
7. Refresh udev rules
Code:
$ sudo udevadm control --reload
$ sudo systemctl restart systemd-udevd.service
Now unplug and plug-in the device again.

8. Check
Now, as your own normal user, issue the command
Code:
$ adb devices
At this moment, the device should prompt you for checking the computer's RSA key. To verify the key by fingerprint, check the output of this command:
Code:
$ cut -d' ' -f1 ~/.android/adbkey.pub | base64 -d | md5sum
If the output MD5 hash matches the one displayed on the device's screen, you're OK to store and accept the key.

After that, `adb devices' command should give you something like this in the output:
Code:
List of devices attached 
0011223344aabbcc	device
P.S.
There is no need to practise the voodoo stuff such as turning the device off and on, turning the computer off and on, repeatedly unplugging/changing USB ports, repeatedly killing and restarting adb, upgrading Android SDK, cycling through the device's debug permissions, starting adb with root privilege, sacrifice a lamb and limb, etc., as suggested all over the Internet. See also: Skinner's pigeons.
__________________
Code:
from rlyeh import cthulhu
cthulhu.fhtagn()

Last edited by aleph; 5th June 2014 at 04:37 AM.
Reply With Quote
  #2  
Old 11th May 2014, 09:57 AM
stevea
Guest
 
Posts: n/a
linuxchrome
Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

Quote:
P.S.
There is no need to practise the voodoo stuff such as turning the device off and on, turning the computer off and on, repeatedly unplugging/changing USB ports, repeatedly killing and restarting adb, upgrading Android SDK, cycling through the device's debug permissions, starting adb with root privilege, sacrifice a lamb and limb, etc., as suggested all over the Internet. See also: Skinner's pigeons.
+1 x2

That paragraph should be a separate thread or even a topic area. Well said.
Reply With Quote
  #3  
Old 4th June 2014, 10:16 PM
nated Offline
Registered User
 
Join Date: Jun 2014
Location: Nevada, USA
Posts: 2
linuxfirefox
Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

In step 7 you need to run the following code to restart udev otherwise it won't work and you will get confused like me
Code:
sudo udevadm control --reload
Reply With Quote
  #4  
Old 5th June 2014, 04:36 AM
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Nanjing, China
Posts: 1,332
linuxfirefox
Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

Quote:
Originally Posted by nated View Post
In step 7 you need to run the following code to restart udev otherwise it won't work and you will get confused like me
Code:
sudo udevadm control --reload
Thanks for pointing that out
__________________
Code:
from rlyeh import cthulhu
cthulhu.fhtagn()
Reply With Quote
  #5  
Old 4th August 2014, 06:12 AM
aatifmoin Offline
Registered User
 
Join Date: Aug 2014
Location: kashmir
Posts: 2
linuxopera
Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

I've done everything u said but adb does'nt work although fastboot does work fine
Reply With Quote
  #6  
Old 4th August 2014, 07:27 PM
CronoCloud Offline
Registered User
 
Join Date: May 2010
Location: Midwest USA
Age: 50
Posts: 513
linuxfirefox
Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

Just a quick tip. Make sure to enable debugging in your device before you plug it in to do the lsusb. Some devices report different device numbers depending on if it is enabled or not.

CronoCloud
__________________
Running Fedora 25 64-bit on a HP/Compaq Presario CQ5320F 2.8GHz Quad-core Phenom II CPU, 8GB RAM, EVGA GT640 SC 1GB GDDR5 rev2 video card.
Vizio E221-A1 22" 1080p HDTV with HDMI, using 1080P (1920x1080) over HDMI
Reply With Quote
  #7  
Old 7th August 2014, 05:55 PM
aatifmoin Offline
Registered User
 
Join Date: Aug 2014
Location: kashmir
Posts: 2
unknownunknown
Unhappy Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

I did it all it just doesn't work but as I said, fastboot works well
Reply With Quote
  #8  
Old 9th February 2015, 12:00 AM
lexonight Offline
Registered User
 
Join Date: Nov 2011
Location: Rhode Island, USA
Age: 42
Posts: 36
linuxchrome
Talking Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

digging up old thread, but this worked for my lg optimus f3 and fedora 21, the debugging mode had to be on for my phone. Thanks
Code:
[yourusernamehere@localhost ~]$ adb devices
List of devices attached 
LGMS659-3bd9e86	device
__________________
If you don't ask, you'll never know
Never insult yourself, there are millions who can do that for you
Dell Latitude E6410 Intel(R) Core(TM) i5 CPU M 580 @ 2.67GHz
NVIDIA GT218M [NVS 3100M]
Fedora 25 Installed
Reply With Quote
  #9  
Old 20th March 2015, 04:45 AM
pawelveselov Offline
Registered User
 
Join Date: Mar 2015
Location: California
Posts: 1
linuxchrome
Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

Couldn't get this to work
Code:
[vps@druid]~$ lsusb|grep -i google
Bus 002 Device 026: ID 18d1:0003 Google Inc. 
[vps@druid]~$ ls -la /dev/bus/usb/002/026
crw-rw-r--. 1 root root 189, 153 Mar 19 20:15 /dev/bus/usb/002/026
[vps@druid]~$ cat  /etc/udev/rules.d/99-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="0003", GROUP="androiddev", MODE="0664"
I did udevadm control --reload and restarted udevadm service, the permission of the device wouldn't change. No combination of 18d1:0003 in /usr/lib/udev/rules.d/* files (not that it should matter).

Not until I ran this:
Code:
$ sudo udevadm test --action=add /sys/bus/usb/devices/2-2
the permissions/group changed.

May be the reconnect the device vodoo is necessary, though I'm sure I've done it once through the process, but I might've wrong USB codes then.

I also have no clue on how to figure out the UDEV node paths from the actual devices...
Reply With Quote
  #10  
Old 10th July 2015, 05:42 AM
jwehrle Offline
Registered User
 
Join Date: Jun 2013
Location: Seattle
Posts: 1
linuxchrome
Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

Be sure not only that debugging is "on" but that the "USB debugging" option inside Developer Options (inside settings) is "on"

This may be covered in another entry but I thought I had finished telling my phone I wanted to allow debugging only to find that I had to specifically say yes again.
Reply With Quote
Reply

Tags
adb, android

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up bridge? (wlan0-eth0) szymex Servers & Networking 20 29th September 2013 04:12 PM
[SOLVED] Connecting Samsing Galaxy s2 with adb on Fedora 15 pballok Hardware & Laptops 6 3rd June 2013 08:37 AM
Android SDK(adb) won't work after recent update in Fedora 17 tewilove Using Fedora 2 27th November 2012 05:04 PM
How to set KVM bridge actworship F15 Development 0 23rd April 2011 03:27 PM
HOWTO Set KDE Integration in Fedora Core 5 or FC6 technoshaun Guides & Solutions (Not For Questions) 3 19th November 2007 08:20 PM


Current GMT-time: 07:18 (Saturday, 19-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat