# Using Android USB Hardware Devices With Android Debug Bridge (adb)



## dmtr (Sep 23, 2013)

Hi all,

I want to use a USB device for Android debugging mode by Android Debug Bridge (adb). The problem is that the Android Debug Bridge does not see the USB device. What do you need to do to see ADB USB device? How to do this in Linux has help http://developer.android.com/tools/device.html. But it is not suitable for FreeBSD. Honestly do not understand how ADB is trying to see the device.


----------



## tingo (Sep 26, 2013)

When you plug in your Android device, is it seen by FreeBSD at all? Check /var/log/messages and `# usbconfig` output


----------



## autumn (Nov 1, 2013)

I also have this problem.  I have also created a .android/adb_usb.ini file in both my user's and root's home directories. My phone is bricked, but the boot logo shows and I can get it into download mode without adb. I am trying to reflash it.


```
# usbconfig -d 1.3 dump_curr_config_desc
ugen1.3: <SAMSUNGAndroid SAMSUNG> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (96mA)


 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0043 
    bNumInterfaces = 0x0002 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00c0 
    bMaxPower = 0x0030 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0001 
      bInterfaceClass = 0x0002 
      bInterfaceSubClass = 0x0002 
      bInterfaceProtocol = 0x0001 
      iInterface = 0x0004  <CDC Abstract Control Model (ACM)>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump: 
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x01
       RAW dump: 
       0x00 | 0x05, 0x24, 0x01, 0x00, 0x01


      Additional Descriptor

      bLength = 0x04
      bDescriptorType = 0x24
      bDescriptorSubType = 0x02
       RAW dump: 
       0x00 | 0x04, 0x24, 0x02, 0x02


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump: 
       0x00 | 0x05, 0x24, 0x06, 0x00, 0x01


     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x000a 
        bInterval = 0x0009 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

    Interface 1
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0001 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0002 
      bInterfaceClass = 0x000a 
      bInterfaceSubClass = 0x0000 
      bInterfaceProtocol = 0x0000 
      iInterface = 0x0005  <CDC ACM Data>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0082  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0001  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000
```


```
Oct 30 20:46:15 satellite kernel: ugen1.3: <SAMSUNG> at usbus1
Oct 30 20:46:15 satellite kernel: umass2: <Mass Storage> on usbus1
Oct 30 20:46:15 satellite kernel: umass2:  SCSI over Bulk-Only; quirks = 0x0000
Oct 30 20:46:15 satellite kernel: umass2:8:2:-1: Attached to scbus8
Oct 30 20:46:15 satellite kernel: cd0 at umass-sim2 bus 2 scbus8 target 0 lun 0
Oct 30 20:46:15 satellite kernel: cd0: <SAMSUNG UMS 0001> Removable CD-ROM SCSI-2 device 
Oct 30 20:46:15 satellite kernel: cd0: 40.000MB/s transfers
Oct 30 20:46:15 satellite kernel: cd0: Attempt to query device size failed: NOT READY, Medium not present
Oct 30 20:46:15 satellite kernel: cd0: quirks=0x10<10_BYTE_ONLY>
Oct 30 20:46:15 satellite devd: Executing 'kldload -n umodem'
Oct 30 20:46:15 satellite kernel: da2 at umass-sim2 bus 2 scbus8 target 0 lun 1
Oct 30 20:46:15 satellite kernel: da2: <SAMSUNG UMS 0001> Removable Direct Access SCSI-2 device 
Oct 30 20:46:15 satellite kernel: da2: 40.000MB/s transfers
Oct 30 20:46:15 satellite kernel: da2: 30432MB (62325760 512 byte sectors: 255H 63S/T 3879C)
Oct 30 20:46:15 satellite kernel: da2: quirks=0x2<NO_6_BYTE>
Oct 30 20:46:15 satellite kernel: (da2:umass-sim2:2:0:1): READ(10). CDB: 28 20 00 00 00 00 00 00 01 00 
Oct 30 20:46:15 satellite kernel: (da2:umass-sim2:2:0:1): CAM status: CCB request completed with an error
Oct 30 20:46:15 satellite kernel: (da2:umass-sim2:2:0:1): Retrying command
Oct 30 20:46:15 satellite kernel: umodem0: <SAMSUNG SAMSUNGAndroid, class 2/0, rev 2.00/4.00, addr 3> on usbus1
Oct 30 20:46:15 satellite kernel: umodem0: data interface 1, has no CM over data, has no break
Oct 30 20:46:15 satellite kernel: ugen1.2: <JMicron> at usbus1 (disconnected)
Oct 30 20:46:15 satellite kernel: umass1: at uhub3, port 3, addr 2 (disconnected)
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3'
Oct 30 20:46:15 satellite kernel: (da1:umass-sim1:1:0:0): lost device - 0 outstanding, 3 refs
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04f2 product 0xb1d6 bus uhub1
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3
Oct 30 20:46:15 satellite devd: Executing 'logger Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3'
Oct 30 20:46:15 satellite root: Unknown USB device: vendor 0x04e8 product 0x689e bus uhub3
Oct 30 20:46:15 satellite kernel: (da2:umass-sim2:2:0:1): READ(10). CDB: 28 20 00 00 00 00 00 00 01 00 
Oct 30 20:46:15 satellite kernel: (da2:umass-sim2:2:0:1): CAM status: CCB request completed with an error
Oct 30 20:46:15 satellite kernel: (da2:umass-sim2:2:0:1): Retrying command
Oct 30 20:46:16 satellite kernel: (da2:umass-sim2:2:0:1): READ(10). CDB: 28 20 00 00 00 00 00 00 01 00 
Oct 30 20:46:16 satellite kernel: (da2:umass-sim2:2:0:1): CAM status: CCB request completed with an error
Oct 30 20:46:16 satellite kernel: (da2:umass-sim2:2:0:1): Retrying command
Oct 30 20:46:16 satellite kernel: (da2:umass-sim2:2:0:1): READ(10). CDB: 28 20 00 00 00 00 00 00 01 00 
Oct 30 20:46:16 satellite kernel: (da2:umass-sim2:2:0:1): CAM status: CCB request completed with an error
Oct 30 20:46:16 satellite kernel: (da2:umass-sim2:2:0:1): Retrying command
Oct 30 20:46:17 satellite kernel: (da2:umass-sim2:2:0:1): READ(10). CDB: 28 20 00 00 00 00 00 00 01 00 
Oct 30 20:46:17 satellite kernel: (da2:umass-sim2:2:0:1): CAM status: CCB request completed with an error

cut
 
Oct 30 20:46:35 satellite kernel: (da2:umass-sim2:2:0:1): CAM status: CCB request completed with an error
Oct 30 20:46:35 satellite kernel: (da2:umass-sim2:2:0:1): Retrying command
Oct 30 20:46:36 satellite kernel: (da2:umass-sim2:2:0:1): READ(10). CDB: 28 20 00 00 00 00 00 00 01 00 
Oct 30 20:46:36 satellite kernel: (da2:umass-sim2:2:0:1): CAM status: CCB request completed with an error
Oct 30 20:46:36 satellite kernel: (da2:umass-sim2:2:0:1): Error 5, Retries exhausted
Oct 30 20:46:37 satellite kernel: (da1:umass-sim1:1:0:0): removing device entry
Oct 30 20:46:38 satellite kernel: ugen1.2: <JMicron> at usbus1
Oct 30 20:46:38 satellite kernel: umass1: <MSC Bulk-Only Transfer> on usbus1
Oct 30 20:46:38 satellite kernel: umass1:  SCSI over Bulk-Only; quirks = 0x4000
Oct 30 20:46:38 satellite kernel: umass1:7:1:-1: Attached to scbus7
Oct 30 20:46:38 satellite kernel: ugen1.3: <SAMSUNG> at usbus1 (disconnected)
Oct 30 20:46:38 satellite kernel: umodem0: at uhub3, port 2, addr 3 (disconnected)
Oct 30 20:46:38 satellite kernel: umass2: at uhub3, port 2, addr 3 (disconnected)
Oct 30 20:46:38 satellite kernel: (cd0:umass-sim2:2:0:0): lost device, 2 refs
Oct 30 20:46:38 satellite kernel: (da2:umass-sim2:2:0:1): lost device - 0 outstanding, 2 refs
Oct 30 20:46:38 satellite kernel: (da2:umass-sim2:2:0:1): removing device entry
Oct 30 20:46:38 satellite kernel: (cd0:umass-sim2:2:0:0): removing device entry
```
I have more if you want it.


----------



## autumn (Nov 1, 2013)

Also I tryed changing the permissions of the device by hand, it was in the udev rules for linux. I just read another topic on making devd rules which might fix the problem.


----------



## dmtr (Nov 12, 2013)

Hi all!

There are some inferences about the ADB (Android Debug Bridge (adb)).
Help page
http://developer.android.com/tools/device.html no mention of the ADB on the FreeBSD platform and even more so about setting up on the platform.
All recommendations are only for Linux.
Cross-platform is conditional and is determined only by the interpreter language JAVA - yes it runs on FreeBSD as well as other applications with JAVA.
Yes, the program works but does not see the device, as does not know anything about the structure of the file system of FreeBSD and trying to find the connected phone is where it should be in Linux.
That's where the device is located in Linux (Ubuntu):
/dev/bus/usb/001/003

How to understand the privileges are not to blame if the device is not detected at all.


----------

