I filed this as an Android bug (AOSP Issue #175555) and somebody recommended posting here. I'm actually not sure it's appropriate to post this here but I'll give it a shot.
- Get into a car a passenger.
- Open your laptop and plug in your phone.
- Watch logcat
- Ask the driver to make their way to the freeway using a route that take more than 5 minutes.
Roughly, after about 5 minutes the phone will disconnect from ADB. Unplugging the phone and plugging it back in, the phone will reconnect but disconnect. Maybe it's an illusion but it seems the faster the car is driving, the quicker it will disconnect.
I've tested this with an HTC One M7 and a OnePlus One. If the OnePlus is not involved, the HTC always seems to be able to reconnected. However, once the OnePlus can't connect enough times, nothing can connect, not even the HTC One. The OnePlus seems to "poison the well" as it were.
I've tried several different USB cables and ports on two computers, a Macbook Pro and a Lenovo Yoga. I'll be on a road trip this summer and can debugging more with a third phone.
If there are any tools that I can use or commands I can run to help debug this issue, please advise and I'll use them the next time I'm debugging my app in the car.
Lastly, sometimes my OnePlus disconnects while on my desk but it's far less frequent and usually only after a long period of not being used.