How HBuilder develops uniapp to add android emulator

We know that it is very convenient to use uniapp to develop multi-terminal apps, and the simulator during the development process can also improve the efficiency of our test code. But we follow the method of uniapp's official website and download the simulator from Google's official website, which is often very inconvenient.

Let's take a look at how to use other emulators.

We know that in android development, the adb.exe program is a tool used to link mobile phones and programs. Therefore, the emulator under android also needs to use this tool.

1. Download and install the Night Simulator

We use the downloaded Night God emulator to complete the installation. The Yeshen emulator is designed for users to play android games on the PC side, so don't be intimidated by the fancy interface when we download it, it can be downloaded from the official website at https://www.yeshen.com/ . You can download it yourself.

2. Modify the configuration to the mobile version

After the Yeshen Simulator is installed, the default is the tablet version, which needs to be modified in the settings.

 Click the above button to set and modify it to the mobile version, as shown in the figure below:

Click Save Settings, select Restart Now, and complete the basic settings.

Next we set up the simulator for hbuilder.

3. Configure hbuilder

Find the night god simulator icon on the desktop,

Right click, select properties,

 Click "Open file location", as follows:

So far, we have determined the location of the emulator: "D:\Program Files\Nox\bin", and found the file "debugreport.bat" under this folder.

 Double-click to run, as shown below:

 Note that the port number is "62001"

 Start HBuilderX, select "Run" --- "Run to Phone or Emulator" --- "Android Emulator Port" in the menu, and configure the path of the adb.exe file and the emulator running port respectively.

After the setup is complete, start the emulator.

In HBuilderX, select "Run" --- "Run to Phone or Simulator" --- "Run to Android App Dock" in the menu.

 Select 120.0.0.1:62001 and check Run with standard base.

 Click Run New Project.

At this point, HBuilderX compiles and runs the app on the emulator, as shown in the figure below:

Guess you like

Origin blog.csdn.net/sweetsoft/article/details/130727169