I am trying to debug some USB attach/detach Intents while using USB Accessory mode to some custom Host hardware. I am able to connect ADB via WiFi TCP/IP and it works great. However, when a USB attach/detach Intent comes along, the ADB connection is broken - even though ADB is not running over USB at all.
After reading countless threads here that dance around that topic, a common suggestion seems to be that having "USB Debugging" checked in Settings will make the ADB connection sensitive to USB. Several posts suggest unchecking that box when running over WiFi/TCP. But I've tried that, and cannot associate ("adb connect 192.168.x.y") if that box is unchecked even when running over WiFi.
I have confirmed that when the box is unchecked, getprops still shows "service.adb.tcp.port 5555" like it always does. I've also tried explicitly killing and restarting the adbd daemon. Nothing works... except checking that box, at which point I can immediately connect via TCP.
So... what's the real story? I must say it FEELS likely that having that box checked would make ADB sensitive to USB even if it's not running on it. But is that box mislabeled, and instead of meaning "USB Debugging" it really means "Debugging regardless of connection type"? I really need to make ADB ignore the USB connection so I can debug attach/detach events. Any help appreciated. Thanks!