adb connection by wifi getting killed when a new USB attached/detached
It is not a adb-connection-by-wifi what gets killed. It is just that USB enumerations affect the sys.usb.*
system properties which on many devices is causing restart of adbd
regardless whether it's being used over USB
or tcpip
.
Do grep "stop adbd" /init*rc
to see what I mean.
You could either comment out those stop adbd
lines or just disconnect the USB cable before running your adb connect
command.
ADB over WiFi connection is lost after disconnecting USB
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.
Tcpip connection established via ADB gets disconnected as soon as the USB is unplugged
For me upgrading adb version from 39 to 41 fixed the issue.
I agree it may not be a fullproof solution, but it worked for me.
Other solution which others mentioned on similar threads were
- migrating from usab3.0 to usb2.0 solved for someone but it didnt solve for me .
- changing usb mode from file transfer to charge only solved for someone but it didnt solve for me.
You can try those too if upgrading adb version doesnt work for you.
Android Studio wireless ADB error (10061)
I recently faced the same problem.
It occurs because your device and PC are connected to different Networks.
Related Topics
Close Application and Remove from Recent Apps/
Upload an Image from Camera or Gallery in Webview
Android: How to Use Webcam in Emulator
Inflateexception with Floatingactionbutton from Official Design Library
Detect Power Button Long Press
Firebase Auth Using Phone Number and Password
Adb Server Is Out of Date. Killing
How to Get Activity's Content View
Android: Can Height of Slidingdrawer Be Set with Wrap_Content
What Are the Differences Between Activity and Fragment
How to Write Style to Error Text of Edittext in Android
Detect Connectivity Change in Android 7 and Above When App Is Killed/In Background
Android:Select Image from Gallery Then Crop That and Show in an Imageview