My end goal is to have an phone emulator 'device' to test out Android projects on a Mac machine via Visual Studio for Mac, which is using Android 7.0, 7.1 or 8.0. Yet, with all this stuff I installed, I STILL can't create a virtual device for any of those android versions. In Visual Studio for Mac, I'm going to Tools Google Emulator Manager. For Xamarin you need Xcode, iOS Simulators, Xcode CLI, Android SDK, Android Emulators, Visual Studio for Mac, Mono, Xamarin.iOS & Xamarin.Android SDK, and all the things that come with it. Lots of things that need to be updated.
-->Important
This article describes functionality and guidance that is in public preview and may be substantially modified before it's generally available. Microsoft makes no warranties, express or implied, with respect to the information provided here.
To build Android apps with Xamarin in C# using Visual Studio, set up these tools then follow the instructions on this page:

- Get the latest version of Visual Studio and ensure Xamarin is installed.
- Ensure the Android SDK is installed via these Visual Studio instructions.
- Review the hardware acceleration guide to get the best emulator performance.
Install the emulator preview
Xamarin Android Emulator Hyper V
Get the installer from the Microsoft Download Center:
Choose the .zip package for Windows or the .dmg for macOS.
When the download has completed, run the installer.
The installer places icons in the Start menu, inside a SurfaceDuoEmulator folder. Use the icon labelled Surface Duo Emulator for Visual Studio to open the emulator before attempting to deploy inside Visual Studio.

After the download has completed:
- Open the SurfaceDuoEmulator_ version _.dmg file.
- Copy the contents of the emulator folder to your local hard drive. (The emulator folder name cannot have periods in it.)
The emulator folder contains a number of shell scripts that can start the emulator. Visual Studio for Mac users should start the scripts with the _vs suffix (eg. run_vs.bat and run_vs_clean.bat).
Run the emulator
Visual Studio will not automatically start the Surface Duo emulator, so you should manually open it before attempting to deploy or debug your Xamarin app.
Follow these instructions to start the emulator, after which it will appear as a deployment option in Visual Studio:
After completing the SDK Setup, you can launch the Surface Duo Emulator for Visual Studio via the Start menu link.
Xamarin Mac Android Emulator Not Starting
In the installation folder, there is a batch file run_vs.bat which you can execute directly. There is also a run_vs_clean.bat file which will start the emulator in a fresh state (rather than continue a previous session).
If the emulator does not start, you might need to update the pointer to your Android SDK installation.
- In a terminal window, navigate to the folder where you copied the emulator
- Type
./run_vs.shto start the emulator.
There is also a run_vs_clean.sh script that will start the emulator in a fresh state rather than continuing a previous session.
Note
The installation folder contains start-up scripts named run and run_vs. The run scripts are intended for developers using Android Studio and the run_vs scripts are for Visual Studio users. The differences are the Android SDK location and the port used for the emulator.
If the emulator is running but does not appear as a deployment option in Visual Studio, close the emulator and re-start, confirming that you are using the script with vs in the name.
Debugging your Xamarin Android App
Open your Project in Visual Studio, build it, and select <build> (Android 10.0 - API 29) (in the list of Running Devices) and deploy.
Debugging (breakpoints, step into, step over, etc) will all work as usual.
Troubleshooting
Surface Duo emulator does not appear in the Visual Studio device list
The current version of the Surface Duo emulator cannot be started by Visual Studio. First manually start the emulator and once it's running it should appear in the list for deployment and debugging:
- Windows - open Start > Surface Duo Emulator and choose Surface Duo Emulator for Visual Studio.
- Mac - start from the command line using
sh ./run_vs.sh(the 'VS' in the script name indicates it is intended for Visual Studio for Mac).
Update the pointer to your Android SDK
If you changed the installation location of the Android SDK from the default, you will need to update the run_vs script to point to the correct installation location. Otherwise, the emulator will not run when you click the shortcut or run the script.
- Find the installation location of the Surface Duo Emulator. The default location is
%USERPROFILE%SurfaceDuoEmulator. - Open the
artifactsfolder inside of the installation folder. - Make a backup copy of
run_vs.bat- You can copy it to something likerun_vs_original.bat. - Open the file
run_vs.batin a text editor. - Verify the
ANDROID_SDK_LOCATIONpath value near the top of the file is correct.
- Find the location you extracted the downloaded Surface Duo Emulator archive to.
- Make a backup copy of
run_vs.sh- You can copy it to something likerun_vs_original_.sh. - Open the file
run_vs.shin a text editor. - Verify the
ANDROID_SDK_LOCATIONpath value near the top of the file is correct.

If you don't have a device to deploy to, you'll need to set up an Android emulator or use a device. If you've already done this, you can skip this step.
If this if your first time building a Xamarin application, you'll need to create a new Android Emulator. You'll see 'Android Emulator' in the debug menu. Click it to start the creation process.
This brings up a UAC prompt to be accepted and then the emulator creation process. The options are automatically populated for a base emulator. If required, change any options and then select Create.
At this point, you may be prompted to agree to the license agreement for the Android emulator. Read through and select Accept to continue the process. This will download the emulator images and finalize the creation of the emulator for use in Visual Studio.
Once the emulator has been created, you'll see a button that says Start. Click it.

You may receive prompt to enable Windows Hypervisor Platform. Follow the documentation to enable this feature for optimal performance.
The Android emulator will launch. Wait for it to fully finish starting and you'll see it displayed in the Visual Studio debug menu. This may take some time if you aren't using hardware acceleration.
Your Android emulator has now been created and is ready to use. Next time you run Visual Studio, the emulator will appear directly in the debug target window and will start when you select it. If you ran into any issues or have performance issues with the emulator, read through the full setup documentation.
Set up iOS device
For this tutorial, we'll focus on setting up and deploying to Android. To deploy to the application to iOS, you'll need to configure the Remoted iOS Simulator for Windows or configure a device for deployment with Hot Restart.



