ADB over WiFi connection is lost after disconnecting USB
adb, android, android-studio
Solution
For some reason, connecting the device in Charge only mode solved the problem. Just make sure "Allow ADB debugging in charge only mode" is enabled before connecting the device.
Other modes caused the connection to be lost, as I have tested on my device running on Android 8.0.0.
Problem
I was trying to run ADB over wifi following answers provided here, and I connect successfully to the device, but I lose connection after disconnecting the USB. The same result with both manual and plugins ways. Also, I have tried this solution, and this one, but without success. Solutions that require the device is rooted won't work for me.