We are setting up a continuous integration server for our Android development and we've quickly run into ADB's waiting for device issue.
For the record, we've already tried a lot of combinations of adb kill-server
, adb start-server
, adb devices
, etc. to no avail.
Sadly, all I've found on the internet are variations of "unplug and replug the device", which is obviously not a solution for us (we can't spare a human being to sit by the CI server to unplug and replug devices before each build).
As a bit of background, we use Jenkins on a Mac, since it runs our CI for iOS too.
While approaching the problem I thought that if at the OS level the device is found, that's at least a start. Indeed, running a command like system_profiler SPUSBDataType
successfully finds the device, including the serial number that ADB reports when working correctly.
I've attempted a few rather lame commands to "refresh" all USB activity, but I've gone nowhere. It's not that you can mount/unmount the device, but to be honest I'm not even sure where the problem is, I don't know enough about low level USB protocols, let alone for Macs. My lurking of the ADB source code was a very, very long shot.
So at this point I'm all ears for a solution that would allow us consistently running Android on our CI server. Be it a few commands before each Jenkins job, patching ADB or any other black magic trick.