How to quickly create an Android simulator

Debugging mobile applications is usually implemented by simulator first, just because it is too troublesome to release them to mobile phones every time. When the application is debugged correctly on the simulator, it can be released to the mobile phone for verification.

First, the way of simulator creation.

In order to observe the running results in the simulator, you need to create the simulator before creating an Android application. There are several ways:

Method 1: enter the Android SDK installation directory (D: \ Android \ Android SDK) and run AVD manager.exe.

Method 2: run vs2015, and then run Android emulator Manager:

Method 3: directly click the shortcut key in the shortcut toolbar to start the AVD Manager:

Choose one of the above three methods.

2、 Simulator configuration created

If the debugging computer environment is Intel's CPU, you can create the following simulators respectively (AMD's CPU can choose another template):

Among them, the first two are accelerated with GPU (commonly used, with fast startup speed), and the last one is accelerated without GPU (slow startup, only for playing, to see how slow it is without GPU acceleration).

Note: when configuring the simulator, the default value of [MV heap] must be 64. Changing to other values may cause the simulator to be started, but the simulator is still not found occasionally.

For example, galaxy_ Api23_ The x86 simulator is configured as follows:

For Intel CPU, it is recommended to set the ram option of Galaxy phone simulator to 768mb. On win7, when the simulator ram is set to be greater than 768mb, some computers may fail to start the simulator normally when using GPU acceleration. If this happens to your computer, you can reduce the ram option to 768 or 512 (which will slow down). However, if the ram is set to 1024MB, the simulator can still start normally. In this case, it is OK not to reduce the capacity of ram.

Three, the creation steps of simulator

Next, take Android 4.4 (API 19) as an example to illustrate the specific creation process (similar to that of other simulators).

The operation effect of API 19 simulator is as follows:

Android 4.4.2 simulator can use Chinese character input (Google Pinyin input method), while Android 5.0 and later simulators cannot use Chinese character input method when running, so they can only test the running effect in English.

Of course, you can also create other types of simulators, such as:

1. Create Galaxy_ Api19 simulator

Run the AVD manager.exe file under D: \ Android \ Android SDK.

In the pop-up window, create an AVD (Android virtual device, AVD for short) and configure the corresponding options (see the above figure).

Note the following settings:

Ram: 1024 by default.

Camera: simulation mode is adopted for the rear (webcam mode of notebook can also be used).

Skin: select "no skin", that is, do not let the keyboard interface appear on the right side of the window. VM heap: the default 64 is adopted. Be careful not to modify this value, otherwise it may fail to start normally or the simulator can not be found even though it is started. SD card: set to 256 or 512. The larger the value, the more programs or data can be saved on the external memory card, but the startup will slow down accordingly. Check the [use host GPU] option to enable GPU acceleration.

Click OK to complete the creation of the simulator.

2. Start simulator

Select the simulator just created and press [start] to run it. The simulator will start slowly for the first time (it will start quickly every time in the future).

3. Modify language and time zone configuration

After startup, run [settings] to modify the language, date, time zone and other configuration information.

4. Modify developer option configuration

After startup, select dev tools and developer options, and set the options to the following contents:

L force GPU rendering: enable [when testing Baidu map application with GPU acceleration with texturemapview, this option must be enabled]

In addition to the above options, all other options can use the default values.

5. Observe whether GPU acceleration is successful

Create a blank app (Android) project, select the simulator just created, and then press < F5 > to debug and run.

Observe the output window. If the information output in the last line is:

HostConnection::get() New Host Connection established …

Indicates that GPU acceleration is successful.

If GPU acceleration fails, check and change the simulator settings, then close the simulator, press < F5 > again to debug and observe until GPU acceleration succeeds.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>