How to use Win10 Android simulator? Win10 Android simulator tutorial

  

How to use Win10 Android Simulator? Visual Studio Emulator for Android is Microsoft released a standalone version of the Android emulator. It is said that the performance of the Visual Studio Emulator for Android emulator is much faster than that of Google's own. You have to admire Microsoft, but you need hyper-v support. The compilation brings a detailed tutorial on using the Win10 Android emulator.

First, turn on Hyper-V virtualization technology (disregarded already turned on);

1 Check Control Panel->Uninstaller->Start or Shut Down Windows Features->Hyper- V-> OK






After downloading, it is a 40M vs_emulatorsetup The .exe file does not contain the image file of the Android emulator. The x86 image of API 19 (Andorid 4.4) will be downloaded online by default. You can also download other API xx versions separately. In addition, Visual Studio Emulator For Android is not dependent on Visual Studio, which means that it can be installed separately. Android Studio uses adb as a bridge to connect Visual Studio Emulator for Android.

I will not list the installation steps, remember to reboot after installation (it needs to add yourself to the administrator group of Hyper-V Administrators).

Open the Visual Studio Emulator for Android after the installation restarts, as shown below:


If you start the emulator, it will automatically create a corresponding in Hyper-V. The x86 Android virtual machine comes as follows:


2. Set up Andorid Studio to use these emulators

Open Android Studio> Run > Edit Configurations > Defaults /Android Application /General tab of the Target Device node, check Show chooser dialog and Use same device for future launches. Remember not to forget to apply Apply and OK. As shown below:



3. Add a shortcut button for launching emulator for Android Studio

Although in the Visual Studio Emulator for Android Manager window The simulator can be started, but it is cumbersome to open it every time, so we add a shortcut button for Android Studio to start Visual Studio Emulator for Android.

3.1 Configuring External Tools

Opening File > Settings > External Tools > Add :


Name: Just write it for you to recognize Just fine, the author is VS Emulator (4.4 API 19).

Program: Fill in the absolute path of emulatoecmd.exe in the Visual Studio Emulator for Android installation directory, use it to start the emulator. The author is C:\\Program Files (x86)\\Microsoft Emulator Manager\\1.0\\emulatorcmd.exe.

Parameters: add the parameters to start the emulator, /sku: Android is the emulator that opens Android, /id: the Guid behind is the unique number of the emulator, the general meaning is to specify which Android to launch Simulator. The id can be obtained by emulatorcmd.exe /sku:Android list /type:device as follows:


Working Directory: Specify the working directory, which should be filled in casually. The author is $ProjectFileDir$.

3.2 Add button to Toolbar

Right click on the toolbar and select Customize Menus and Toolbars. Then navigate to Main Toolbar > Add After > in the pop-up panel, find External tool > VS Emulator (4.4 API 19) and press OK. As follows:


Then click on our newly added button, you can start the Android emulator:


4. Add Contect for Android Studio Simulator shortcut button

The third section of the button just starts the emulator, but Andorid Studio can't connect to the emulator. Here you need to use the adb command to connect to the emulator you just started.

4.1 Configuring External Tools

The same is to add a shortcut button, the steps are the same as the third part, but the parameters are different, here I only list the parameters:

Name: Just write it, it's easy for you to recognize it. The author is adb Connect (VS Emulator).

Program: Fill in the absolute path of adb.exe, the author is D:\\_android\\sdk\\platform-tools\\adb.exe.

Parameters: Add adb.exe parameters, connect ip: 5555; the author is 192.168.2.233:5555. Ip can be viewed in wifi by opening the emulator, or in the network of the emulator settings


Working Directory: Specify the working directory, it should be free to fill in of. The author is $ProjectFileDir$.

4.2 Add button to Toolbar

The steps are the same as 3.2, which will not be explained here. Stick a picture:


5. Debug Android App with Visual Studio Emulator for Android

Press the Run button (green arrow that...), pop up and select Android Device selection box:


OK, you're done:


6. Further improvement

Before each debugging Start the emulator button, wait for the emulator to start and then click the button of the contect emulator, then you can click run debug, and it's cumbersome.

Let's configure the command to be executed before the run, let the run button do all three things!

Open the BeforeLaunch node of the Run > Edit Configurations > Defaults /Android Application /Emulator tab, add the two External Tools we just created here, remember not to forget to apply Apply and OK, the order is as follows :





Copyright © Windows knowledge All Rights Reserved