Forum Discussion
Unable to launch the Surface DUO Emulator with Visual Studio
Dear Team, I have been facing issues with the Duo Emulator launch with the Visual Studio 2019, as the emulator not shows in visual studio build option(<build> (Android 10.0 - API 29) ). I have followed the official instruction . So far I didn’t find any solution. Below am giving the details.
Problems
- Unable to launch the emulator directly after modified run.bat file: When I click the Surface Duo Desktop Icon a command prompt launch and suddenly go to crash.
- <build> (Android 10.0 - API 29) : emulator not appear in VS-Xamarin 2019 build option
Things I done
- Followed the official Doc instruction : installation (VS 2019- Xamarin , Surface Duo emulator, Xamarin Android SDK Manager Emulator option checked ), run.bat file modification, Hyper V enabled.
- Installed the Android Studio
Things that works (before modifying run.bat )
The emulator successfully launch with the Android SDK (run_androidstudio.bat😞 I have already installed VS 2019 with Xamarin. And once I installed the Surface Duo emulator, I try to directly launch the emulator by clicking emulator icon, however its not respond, then I installed the android studio and tried again, and it was successfully launched.
Please advise, Thanks.
Sivaprasad. G if you see the Surface Duo emulator, check the port showing in the title bar (it will say something like "Android Emulator - <build>:5556").
That should match the post listed by adb devices, even though the rest of the name may not match exactly. I've attached a screenshot of how it looks for me.
I'll add that whenever I use the Visual Studio batch file (run_vs.bat), I get a low-numbered port (like 5554 or 5556). I notice in your list it's 5578. Check that your batch file does not specify the -ports parameter (and also confirm the ANDROID_SDK_LOCATION is the one in C:\Program Files (x86\Android\android-sdk).
20 Replies
- tggmbiFormer Employee
Hi Sivaprasad. G ,
When I tried this I didn't hit your error but still I wasn't able to successfully connect the emulator to Visual studio.
what finally enabled me is to change the ANDROID_SDK_LOCATION in the Xamarin version from:
set ANDROID_SDK_LOCATION=C:\Program Files (x86)\Android\android-sdk (the line copied from the instructions to the same line I used when connecting the emulator to Android Studio:
set ANDROID_SDK_LOCATION=%LOCALAPPDATA%\Android\Sdk
if you changed this line to enable the emulator on android studio, please use the same location with the Xamarin script.
I have attached the version that worked for me (note that this site doesn't allow attaching txt or bat files so I pasted it into a word doc 🙂
please let me know if this helps.
Meir
Hello tggmbi ,
Thank you for your prompt reply, I went through your solution and changed the ANDROID_SDK_LOCATION location as you mentioned,(same location which work with android studio) but still I wasn't able to successfully connect the emulator to Visual studio.
Sivaprasad. G- tggmbiFormer Employee
I am sorry that didn't work...
can you attach the script you are running and the script that works for you in android studio?
thanx,
Meir