Devices on adb are fluctuating I have Ubuntu running on a Mac Mini with adb 1.0.31. I am trying to attach 3 devices directly and four devices via a powered hub. Every time devices attached start to fluctuate on adb after some time. For example I would see all the devices attached initially but within a few minutes last 2-3 devices will come and go on adb every now and then. Eventually more will behave same way.

I checked on dmesg and found this:

[ 1001.384481] xhci_hcd 0000:00:14.0: Not enough host resources, active endpoint contexts = 60
[ 1001.384495] hub 3-4.4:1.0: couldn't allocate port 4 usb_device


I have tried Fedora on Mac mini as well and I am seeing the same issue. I have tried on 4 different Mac Minis as well.
I've had the same problem when trying to use ADB on lots of devices on one hub. ADB uses a lot of the available USB bandwidth, so when many devices are on one hub, they can't all get the bandwidth they need. There are several suggestions you might try:-


Use ADB over the network instead of USB. If you don't know how to enable this on the device, there are a few apps to help you. Once it's enabled on the device, use adb connect ip.ip.ip.ip:port from the development machine.
Make sure the cables are plugged into a USB 2.0 port, not USB 1.1. USB 3.0 is even better if the development machine supports it. The different versions of USB are all compatible, but later versions have much more bandwidth.
Try a better hub. Cheap hubs are designed for plugging a USB storage device alongside a keyboard and mouse, and don't cope well with high bandwidth use. A professional-level USB hub will do a much better job - but it still might not be enough to connect all your ADB devices at once.