It was really strange that adb wifi was disconnecting and debugging via cable is way more unreliable as well as uncomfortable.I did research on internet too. I did try many possible solutions, changing adb drivers, wifi mode and etc. But can't find the problem. It's just keeps disconnecting. I tried to make a loop to keep alive the adb connection.
:loop
adb connect 10.226.170.129:4444
goto loop
But, still didn't work. Even after running this loop infinitely it still disconnected.
WiFi adb is great tool to debug wirelessly. But, there can be many problems to face. So, try this guideline.
adb devices
if not then
Update adb drivers. click here...
else
adb tcpip 4444
Here 4444 is a port number which can be replaced with any 4 digit number.
5. remove the device from usb port.
6. execute this command : adb connect IP of your device: port num
Ip can be anything. It can be found under about section of your device and port number is 4 digit number. for example I will run
...
adb connect 10.226.170.129:4444
...
Done it should be connected now.
kill adb-server
and then start adb-server
. Then follow the procedure.adb shell setprop service.adb.tcp.port 4444
before adb tcpip 4444
.Hope this works.
REFERENCES