This is only a partial solution. Yes, you can reconnect via Wi-Fi (which works fine, BTW), but as soon as you disconnect or reconnect the USB cable, you will lose connection with ADB again - even if it works via WiFi and should not depend on USB on all.
So be careful, this works, but will not solve the problem if, for example, you try to debug everything that is connected with USB attach / detach Intents.
source share