Launch Android Emulator from within Visual Studio on Ryzen 2700X

I have a Windows 10 PC with an AMD R7 2700X. I followed the instructions provided by Microsoft and I set up the Windows Hypervisor Platform on my system. I can run the Android Emulator with Hardware Acceleration from the Command Line using this command:

"C:\Program Files (x86)\Android\android-sdk\emulator\emulator.exe" -partition-size 512 -no-boot-anim -avd Android_Accelerated_x86_Oreo -prop monodroid.avdname=Android_Accelerated_x86_Oreo

However, when I press the "play" button in Visual Studio, I get a warning that Intel HAXM is not installed. The command that ends up running the Android Emulator is this:

C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -partition-size 512 -no-boot-anim -no-accel -avd Android_Accelerated_x86_Oreo -prop monodroid.avdname=Android_Accelerated_x86_Oreo

The problem here is that the emulator is run with the -no-accel option. I know I can add parameters to the launch command using Tools > Options > Xamarin > Android Settings, but the -no-accel option is always there no matter what.

Is there a way to remove this option? Could this be in a future update?

Answers

  • Ahsan_SiddiqueAhsan_Siddique PKMember ✭✭✭✭

    @ConnorSchmidt said:
    I have a Windows 10 PC with an AMD R7 2700X. I followed the instructions provided by Microsoft and I set up the Windows Hypervisor Platform on my system. I can run the Android Emulator with Hardware Acceleration from the Command Line using this command:

    "C:\Program Files (x86)\Android\android-sdk\emulator\emulator.exe" -partition-size 512 -no-boot-anim -avd Android_Accelerated_x86_Oreo -prop monodroid.avdname=Android_Accelerated_x86_Oreo

    However, when I press the "play" button in Visual Studio, I get a warning that Intel HAXM is not installed. The command that ends up running the Android Emulator is this:

    C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -partition-size 512 -no-boot-anim -no-accel -avd Android_Accelerated_x86_Oreo -prop monodroid.avdname=Android_Accelerated_x86_Oreo

    The problem here is that the emulator is run with the -no-accel option. I know I can add parameters to the launch command using Tools > Options > Xamarin > Android Settings, but the -no-accel option is always there no matter what.

    Is there a way to remove this option? Could this be in a future update?

    Hi,

    Please share the screenshot of your problem. I can help.

  • ConnorSchmidtConnorSchmidt USMember ✭✭

    @Ahsan_Siddique What do you need a screenshot of?

  • Ahsan_SiddiqueAhsan_Siddique PKMember ✭✭✭✭

    @ConnorSchmidt said:
    @Ahsan_Siddique What do you need a screenshot of?

    Of your error message.

  • ConnorSchmidtConnorSchmidt USMember ✭✭

    @Ahsan_Siddique It's not really an error message. It's just a notification that the Android Emulator that was launched from within Visual Studio is NOT running using Hardware Acceleration. This is because Intel HAXM is not installed (since this is an AMD PC). So, there is no error message. The emulator works just fine. It is just very very slow.

    If I use command line to launch the emulator, Hardware Acceleration works just fine. It is nice and snappy like the emulator would be on an Intel platform.

    As I mentioned in the original post, the only difference between when I launch the emulator from Visual Studio and from command line is the lack of the -no-accel option. Xamarin detects that my PC is not running Intel HAXM and automatically adds the -no-accel option to the emulator launch command. I want to remove the -no-accel option from the launch command so that running the emulator through Visual Studio works the same as when I type the command manually.

    Hopefully this makes sense. It's really just a convenience thing. If it's possible to change it, that's great. If not, I'll live.

  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    @ConnorSchmidt - Can you file an issue on this via Help > Send Feedback > Report a Problem? We definitely should be launching with the right arguments and not force -no-accel here.

    We recently added support for Hyper-V (and AMD Ryzen processors) to the Android emulator from Google, so this should all work accelerated.

    Feel free to post the link once you've filed the issue, and I'll have the team look into it today.

  • ConnorSchmidtConnorSchmidt USMember ✭✭
    edited October 2018

    @PierceBoggan said:
    @ConnorSchmidt - Can you file an issue on this via Help > Send Feedback > Report a Problem? We definitely should be launching with the right arguments and not force -no-accel here.

    We recently added support for Hyper-V (and AMD Ryzen processors) to the Android emulator from Google, so this should all work accelerated.

    Feel free to post the link once you've filed the issue, and I'll have the team look into it today.

    I submitted the report. You can find it here: https://developercommunity.visualstudio.com/content/problem/365292/launch-android-emulator-from-within-visual-studio.html

    I made the mistake of submitting the report through my Intel based laptop and not through my Ryzen PC, so the information regarding the version of VS is incorrect. If this is a problem, I'll delete the report and resubmit later when I have access to my other computer.

    Thanks!

  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    @ConnorSchmidt I'll have the team take a look on this initial request. It probably wouldn't hurt to attach some information from your Ryzen PC for clarity. Thanks!

Sign In or Register to comment.