4

I'm testing an Android app on an emulator with Android Studio, but it seems that ADB is also connecting to another device on the local network ( an Android TV, a SONY) automatically.

If I type

adb devices

, I can see it listed under it's LAN IP address.

I don't remember enabling this — Where can I turn this off?

To clarify: My problem is that ADB connects automatically. I don't want it to connect to that device automatically.

treesAreEverywhere
  • 3,722
  • 4
  • 28
  • 51
  • Do you think you are not running your TV in developer mode ? Reading https://stackoverflow.com/questions/31421872/adb-connection-to-an-androidtv my first guess would try to check settings on the TV – Simson Mar 08 '20 at 01:40
  • 1
    I'm actually sure the TV has developer mode enabled, otherwise ADB would not connect to it at all. The question I'm asking is: why is ADB connecting automatically to this device? How can I stop it from auto-establishing the connection? – treesAreEverywhere Mar 10 '20 at 01:00
  • I have the same problem with Nvidia Shield. Have you fixed that? – Mateusz Kaflowski May 20 '20 at 22:45

2 Answers2

1

Edit:

Replacing adb file with new one fixed the issue for me.

Old:

This could be the answer https://stackoverflow.com/a/60540568/1604309

Try:

On linux/mac: 
adb kill-server && ADB_MDNS=0 adb start-server 

On windows: 
cmd /C "set ADB_MDNS=0 && adb kill-server && adb start-server"
Mateusz Kaflowski
  • 2,221
  • 1
  • 29
  • 35
0

If you do not select a device in adb it will not use it. listing a device in adb do not means it is using it but it means adb has found it. if you do not want adb found your device in the local network you can try one of these:

  1. Disable debugging mode in your device (here in your TV)

or

  1. Block adb in your windows firewall to communicate in this network

or

  1. Disable sharing in your network at PC or change your network type from private to public in PC to prevent finding devices in network (if you do this other PC apps also can not find your devices in this network)
ygngy
  • 3,630
  • 2
  • 18
  • 29