adb does not see visual studio emulator for android instance adb does not see visual studio emulator for android instance windows windows

adb does not see visual studio emulator for android instance


I was facing similar issue and in my case the setup was like following

Versions

  • Windows 10 pro Version 1803 (OS Build 17134.165)
  • Visual Studio Emulator for Android Android
  • OS hosted byemulator Marshmallow (6.0.0) (4.4) API Level 24 Emulated Device 5.7"screen XXDPI Phone "Similar to Samsung Galaxy note4"

In my case I also installed Android Studio which I think it has contributed to the problem by installing SDK under my user folder

C:\Users\[name with space]\AppData\Local\Android\Sdk

Visual Studio also installed Sdk in program files

C:\Program Files (x86)\Android\android-sdk

I decided to move/install android-sdk in c:\Android to avoid issue

Android SDK location should not contain whitespace, as this cause problems with NDK tools

Solution

What I had to do was to consolidate all the Environment variables and Registry entries to point to the right folder

This Stackoverflow question/answer would help in setting registry

'Visual Studio Emulator for Android' devices are not listed in the Android Device Monitor

Then from within visual studio (Tools > Android > Android SDK Manager) open SDK Manager

Open SDK Manager

Go to tools tap and make sure "Android SDK Location" is set to C:\Android\Sdk and also following items are checked

Android SDKs manager

Then in environment variable make sure There is System Environment variable called ANDROID_HOME and the value should also be c:\android\sdk

In my case there was a ANDROID_HOME User Environment which was overriding the system one. Either get rid of that or change it to c:\android\sdk

Once you've updated all these registry and environment variables close all command prompt windows and open a new one (to have environment variables set correctly)

Then check android home by running following command

C:\>echo %ANDROID_HOME%c:\android\sdk

Also echo %path% and it should have a path pointing to c:\android\sdk\platform-tools and no other pathsThen run adb --version and make sure it is running as c:\android\

adb --version

and then run

adb kill-serveradb start-server

Once you have done that lunch Visual Studio for Android and run your image of choice. Then adb devices should return the emulator IP address

Extra Resources

There is a good documentation for general troubleshooting the Visual Studio for Android which you can follow for initial troubleshooting:

https://msdn.microsoft.com/en-us/library/mt228282.aspx