Forum Visual Studio

Cannot Deploy to Surface Duo Emulator

FritzSwitzerFritzSwitzer USMember ✭✭

I can open and run the Surface Duo Emulator from the command line, create a Xamarin Mobile app (Android, UWP) but when I try to deploy using the Android as the Startup Project, I am unable to select the Surface Duo Emulator as an Android Device.

There is no error msg, because the device is not available. Other Android (x86) emulators are available.

If I create and open an Android project using Android Studio, the Surface Duo is recognized and is available as a device.

Any ideas?

Best Answer

  • FritzSwitzerFritzSwitzer US ✭✭
    Accepted Answer

    This fixed it....start emulator prior to launching Visual Studio

    https://docs.microsoft.com/en-us/dual-screen/android/use-emulator?tabs=windows#xamarin-developers

    There is a document about how to use the Surface Duo emulator with Xamarin apps.

    Find the installation location of the Surface Duo Emulator. The default location is %USERPROFILE%\SurfaceDuoEmulator.
    Open the artifacts folder inside of the installation folder.
    Make a backup copy of run.bat - You can copy it to something like run_androidstudio.bat.
    Open the file run.bat in a text editor.
    Replace the entire contents of the file with the snippet for your platform below:
    Verify the ANDROID_SDK_LOCATION path value near the top of the file is correct (the default Visual Studio install location is specified).

Answers

  • jezhjezh Member, Xamarin Team Xamurai
    edited April 8

    Have you installed Nuget Xamarin.DuoSdk in your app?

    When we check official document Integrate with the SDK,we will find:

    To use the Surface Duo SDK in your Xamarin app:

    In Visual Studio:

    • Open the NuGet Package Manager dialog for your project.
    • Under the Browse tab, search for Xamarin.DuoSdk.
    • Install the Xamarin.DuoSdk package into your project.

    After that, if this problem persists, you can try to delete the bin and obj folders, then restart VS and try again.

  • FritzSwitzerFritzSwitzer USMember ✭✭

    I launched SurfaceDuo Emulator , deleted Bin / Obj folders. Added Xamarin Surface Duo from Nuget to the Android project references. and the SurfaceDuo Emulator did not appear in my list of emulators. The usual emulators non-surfaceduo are listed and open when I run the app. Wish I could find a simple Quickstart for Create Android app for Surface Duo using Visual Studio 2019 Community.

  • jezhjezh Member, Xamarin Team Xamurai

    Have you checked the official document: https://docs.microsoft.com/en-us/dual-screen/android/ ?

  • FritzSwitzerFritzSwitzer USMember ✭✭

    Checked the documents, but nothing provides an answer to the question.

    How do I create an Xamarin Forms (Android) app using Visual Studio 2019 and deploy it to a Microsoft Surface Duo Emulator?

  • FritzSwitzerFritzSwitzer USMember ✭✭
    Accepted Answer

    This fixed it....start emulator prior to launching Visual Studio

    https://docs.microsoft.com/en-us/dual-screen/android/use-emulator?tabs=windows#xamarin-developers

    There is a document about how to use the Surface Duo emulator with Xamarin apps.

    Find the installation location of the Surface Duo Emulator. The default location is %USERPROFILE%\SurfaceDuoEmulator.
    Open the artifacts folder inside of the installation folder.
    Make a backup copy of run.bat - You can copy it to something like run_androidstudio.bat.
    Open the file run.bat in a text editor.
    Replace the entire contents of the file with the snippet for your platform below:
    Verify the ANDROID_SDK_LOCATION path value near the top of the file is correct (the default Visual Studio install location is specified).

Sign In or Register to comment.