Search code examples
androidandroid-emulatorvisual-studio-emulator

Visual Studio Emulator for Android is frequently detached from ADB


Visual Studio Emulator for Android works great with Android Studio. There is only one problem I am experiencing now: It is detached from ADB frequently. I can start the emulator and load an app to run without any problem. However, after a while, it is detached without any warning. Android Studio and Android Device Monitor do not see the emulator anymore while they can always see a physical device connected to the dev machine without any problem, so I assume ADB works fine. Restarting the emulator will restore the attachment, but it will detach again after a while. Resetting ADP does not help.


Solution

  • I've been having the exact same problem. It's not a fix, but a workaround; you can manually reconnect ADB to the emulator using command line:

    adb connect <ip>:5555
    

    (from Prem's answer on a similar question)

    You can find the value for < ip > if you look in the ADB logs. You'll probably see something similar to

    ExecutionException getting info for device 123.456.123.456:5555

    Or you can open the 'Additional Tools' of the emulator and see the Network Addresses.