HowTo: set-up adb (Android Debug Bridge) on Fedora 20
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 10 of 10
  1. #1
    aleph's Avatar
    aleph is offline Banned (for/from) behaving just like everybody else!
    Join Date
    Jul 2007
    Location
    Nanjing, China
    Posts
    1,332

    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.
    Last edited by aleph; 5th June 2014 at 04:37 AM.
    Code:
    from rlyeh import cthulhu
    cthulhu.fhtagn()

  2. #2
    stevea Guest

    Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

    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.

  3. #3
    Join Date
    Jun 2014
    Location
    Nevada, USA
    Posts
    2

    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

  4. #4
    aleph's Avatar
    aleph is offline Banned (for/from) behaving just like everybody else!
    Join Date
    Jul 2007
    Location
    Nanjing, China
    Posts
    1,332

    Re: HowTo: set-up adb (Android Debug Bridge) on Fedora 20

    Quote Originally Posted by nated
    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()

  5. #5
    Join Date
    Aug 2014
    Location
    kashmir
    Posts
    2

    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

  6. #6
    Join Date
    May 2010
    Location
    Midwest USA
    Age
    51
    Posts
    518

    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 28 64-bit on a HP/Compaq Presario CQ5320F 2.8GHz Quad-core Phenom II 925 CPU, 16GB RAM, EVGA GTX1050 TI SC 4GB GDDR5 video card. Vizio E221-A1 22" 1080p HDTV with HDMI, using 1080P (1920x1080) over HDMI

  7. #7
    Join Date
    Aug 2014
    Location
    kashmir
    Posts
    2

    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

  8. #8
    Join Date
    Nov 2011
    Location
    Rhode Island, USA
    Age
    43
    Posts
    37

    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

  9. #9
    Join Date
    Mar 2015
    Location
    California
    Posts
    1

    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...

  10. #10
    Join Date
    Jun 2013
    Location
    Seattle
    Posts
    1

    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.

Similar Threads

  1. How to set up bridge? (wlan0-eth0)
    By szymex in forum Servers & Networking
    Replies: 20
    Last Post: 29th September 2013, 04:12 PM
  2. [SOLVED]
    Connecting Samsing Galaxy s2 with adb on Fedora 15
    By pballok in forum Hardware & Laptops
    Replies: 6
    Last Post: 3rd June 2013, 08:37 AM
  3. Replies: 2
    Last Post: 27th November 2012, 05:04 PM
  4. How to set KVM bridge
    By actworship in forum F15 Development
    Replies: 0
    Last Post: 23rd April 2011, 03:27 PM
  5. HOWTO Set KDE Integration in Fedora Core 5 or FC6
    By technoshaun in forum Guides & Solutions (Not For Questions)
    Replies: 3
    Last Post: 19th November 2007, 08:20 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •