Development of mobile applications requires careful testing on various device configurations. Buying dozens of physical smartphones to check compatibility is not a cheap pleasure and is extremely inconvenient.

This is where the emulator built into the development environment comes into the picture. Android Studio. This tool allows you to run virtual copies of the operating system directly on your computer, emulating the behavior of a real gadget.

Correct configuration of this tool is critical to the speed and reliability of the tests. In this article, we will walk you through all the steps: from creating your first virtual device to fine-tuning performance settings.

Prerequisites and system resources

Before you start creating a virtual device, you need to make sure that your computer meets the minimum requirements. Emulation requires significant computing power, since in essence you are running a full-fledged OS inside another.

A key component is support for virtualization at the processor level. Without enabled technology VT-x (for Intel) or AMD-V (for AMD), the emulator will work extremely slowly or will not start at all. You can check the status through the task manager or BIOS of your motherboard.

It is also worth paying attention to the amount of RAM. For comfortable operation of both the Android Studio emulator and the emulator at the same time, it is recommended to have at least 16 GB of free RAM. A smaller volume will lead to constant access to the paging file and serious interface slowdowns.

Make sure that you have the latest versions of your video card drivers installed. The graphics accelerator GPU takes the main load when rendering the Android interface, and outdated software can cause artifacts or application crashes.

โš ๏ธ Attention: If you are using a laptop with hybrid graphics, make sure that Android Studio is configured to use a discrete graphics card, and not built into the processor.

Installing components and selecting a system image

After installing the development environment itself, you need to download additional components via SDK Manager. The tab SDK Tools contains a package Android Emulatorwhich must be checked for installation.

The next step is to select the system image. In the device manager (Device Manager), click the create a new device button. You will see a list of available versions of Android, from old API 21 to the latest releases.

When selecting an image, pay attention to the "ABI" column. For maximum performance on modern PCs with processors x86_64 you should choose images marked Google APIs or Play Storehaving an x86 architecture. Running ARM architecture images on an Intel processor will require emulation of instructions, which reduces the speed significantly.

Some images are marked with a Play Store icon. This means that Google services will be pre-installed in the virtual device, which is necessary for testing applications that depend on maps, notifications or authorization through a Google account.

โš ๏ธ Attention: The SDK Manager interface and available images can be updated by developers. Always check the official documentation if you cannot find the required component in the list.

๐Ÿ“Š Which version of Android do you most often test?
Android 10
Android 11
Android 12
Android 13 and later

Creating and basic device configuration

At the stage of setting up the device profile, you you are invited to select a physical model from the list or create your own configuration. For most tasks, standard profiles are suitable, such as Pixel 6 or Pixel Tablet.

In the equipment configuration window, pay special attention to the parameter RAM. By default, the emulator can reserve up to 4 GB of memory, which may be excessive for simple tests or critically small for heavy games. The optimal value is considered to be 2048โ€“4096 MB.

The amount of internal memory (Internal Storage) and the presence of an SD memory card are also adjusted here. These settings affect how the application will behave when running out of space, which is an important testing scenario.

At this point, you can also enable or disable the use of GPU hardware acceleration. The option Use Host GPU is usually enabled by default in new versions, providing smooth animation of the interface.

โ˜‘๏ธ Check before starting

Completed: 0 / 4

Fine-tuning performance and graphics

Editing the configuration file is available for advanced users config.ini, located in the specific device folder. Here you can manually set the screen resolution, pixel density (DPI) and other specific parameters.

One โ€‹โ€‹of the most useful functions is the ability to change the screen orientation and multi-touch gestures. The emulator fully supports mouse control as a finger, and also emulates the accelerometer and gyroscope through the control panel.

If you are developing games or applications with heavy graphics, make sure that the rendering settings are set to Hardwarerather than Software. Software rendering is used only for debugging graphics drivers and works very slowly.

The "Cold Boot Now" function is also worth mentioning. Sometimes the emulator saves the system state when closing (Quick Boot), which speeds up restart, but can lead to the accumulation of errors in the session. Cold boot resets the device to factory settings.

What is Cold Boot and when to use it?

Cold Boot completely reboots the virtual device, ignoring the saved snapshot. This must be done if the emulator behaves incorrectly, freezes, or if you have installed system updates that require a full reboot to take effect. A normal startup (Quick Boot) restores the state from the last time it was closed, which saves time, but can carry over software errors from the previous session.

Network settings and communication emulation

The Android emulator has its own virtual network, different from the network of the host machine. By default, it uses a proxy server to access the Internet, which allows it to work even in corporate networks with severe restrictions.

To test various communication conditions, the emulator control panel (Extended Controls) offers a simulation of network quality. You can artificially create conditions EDGE, 3G or LTEas well as set latency and packet loss.

This is critical for testing how your application behaves on a poor connection. Many developers test only on Wi-Fi, forgetting that users may be in an area of โ€‹โ€‹โ€‹โ€‹uncertain reception.

In addition, the emulator allows you to change geolocation. You can set specific coordinates or upload a file GPX/KML to simulate the user's movement along the route, which is indispensable for testing navigation services and taxi aggregators.

Network parameter Speed (Kbps) Delay (ms) Use scenario
GSM / CSD 14.4 / 14.4 500 Testing in areas with extremely poor signal
HSCSD 14.4 / 57.6 200 Outdated data transmission standards
GPRS 56.0 / 56.0 150 Slow mobile data
EDGE 118.0 / 118.0 100 Basic coverage in rural areas
UMTS / 3G 384.0 / 384.0 50 Standard mobile connection

Debugging and working with the emulator console

Each running emulator opens a port on the local machine through which console commands can be sent. This allows you to automate testing processes and change settings on the fly without using a graphical interface.

A utility is used to connect to the console telnet. The emulator address usually looks like localhost:5554, where the port depends on the order in which the devices are launched. Through the console, you can change the battery level, network status, and even simulate incoming calls.

Command gsm voice allows you to switch the voice communication status between registered in the network and no signal. This helps check how the application reacts to network loss during an important operation.

You can also control the camera through the console. You can switch the source of the video stream between the computer's webcam and the emulated image, which is convenient for testing video calling functions without the need to be physically present in front of the lens.

telnet localhost 5554

auth token

gsm signal 0

gsm voice unregistered

๐Ÿ’ก

To obtain a console authorization token, use the command `adb emu auth token`, copy it and paste it into the telnet session for unlocking control commands.

Solving common problems and errors

One โ€‹โ€‹of the most common problems is the error message "x86 emulation currently requires hardware acceleration". It directly indicates that virtualization is disabled in the BIOS or is not supported by the processor. The solution lies in the settings of the motherboard.

Another common problem is a black screen at startup. This is often due to incorrect operation of the graphics driver or a version conflict. Try switching the rendering mode in the device settings to Software for diagnostics, and then update the video card drivers.

If the emulator starts but is extremely slow, check whether the amount of allocated memory on the host machine is exhausted. Closing unnecessary browser tabs and background applications can free up the necessary resources for QEMU the engine underlying the emulator.

In rare cases, a complete reinstallation of the platform-tools and system image helps. Emulator files can become damaged when the computer is shut down incorrectly, and clearing the cache (Wipe Data) in the device manager often solves the problem of being stuck on the logo.

โš ๏ธ Attention: Wipe Data will delete all installed applications and files inside the emulator. Do this only if the safety of data inside the virtual machine is not important.

๐Ÿ’ก

Most problems with emulator performance can be resolved by enabling virtualization in the BIOS and allocating enough RAM.

Frequently asked questions (FAQ)

Is it possible to run the emulator on a computer with a processor AMD?

Yes, modern versions of Android Studio and the emulator fully support AMD processors. Previously, there were problems with the compatibility of virtualization drivers, but now the Windows hypervisor (WHPX) or our own solutions are used, which work stably on the AMD Ryzen and Athlon architecture.

Why does the emulator not see the Internet, although it is on the computer?

This may be due to the proxy server settings in the emulator or blocking the connection firewall. Try resetting the emulator's network settings via the console with the command network reset or check the DNS settings in the device configuration file.

How to take a screenshot of the emulator screen?

In the advanced settings panel (Extended Controls) there is a "Screenshots" tab. You can also use the camera button in the bottom control panel of the emulator window. Screenshots are saved to the project folder or clipboard depending on the settings.

Is it possible to install an APK file by dragging and dropping?

Yes, this is one of the most convenient functions. Simply drag the file .apk from your operating system's explorer directly into the running emulator window. The system automatically initiates the application installation process.