How to disconnect a device connected via adb

10.2k Views Asked by At

I'm using the following Terminal commands to connect to an Android TV box I'm developing on:

cd /Library/Android/sdk/platform-tools

./adb connect [my.device.ip.address]:5555

And it's working just fine. But when I'm attempting to disconnect from the device using the following command:

./adb disconnect [my.device.ip.address]:5555

I get the following response:

disconnected [my.device.ip.address]:5555

But in fact, I'm still connected to it. This is super strange as I'm using this command for a long time now and I never had any issues disconnecting from a device. The only new thing in my setup, is a new version of Android Studio (version 3.5.2).

Anybody knows what changed and how can I disconnect from my device now?

2

There are 2 best solutions below

0
Misha Akopov On

If you need to kill connection 100% use

adb kill-server
3
isopach On

Just use

adb disconnect

and it will disconnect all devices connected via TCP. No need to specify the IP address if you're using just one device.

If it still reconnects instantly then you might have an app/script running in the background that automatically reconnects to adb.