The development of mobile applications is inextricably linked with the need to test code on different device configurations. Physical smartphones and tablets are not always at hand, and purchasing a fleet of devices to test compatibility can cost a fortune. This is where the built-in tool comes to the rescue Android Virtual Device (AVD), which allows you to run virtual copies of the operating system directly on your computer.

The process of installing and initially configuring an emulator often causes difficulties for novice developers due to many hidden parameters and hardware requirements. An incorrectly selected system image or the lack of hardware virtualization can turn work into torture with constant freezes. In this guide, we will look in detail at how to correctly create an emulator, optimize its performance, and avoid typical configuration errors.

You will learn what parameters affect loading speed, how to correctly distribute RAM resources between the host machine and the virtual device, as well as which system images are best to choose for specific tasks. Proper setup Android Studio at the start will save you hours of debugging in the future.

Preparing the environment and checking system requirements

Before you start creating a virtual device, you need to make sure that your computer meets the minimum requirements for comfortable operation of the emulator. The heavy images of modern versions of Android require significant computing resources, and trying to run them on weak hardware will result in extremely poor performance.

A critical element is the processor's support for hardware virtualization. For processors Intel this technology is called VT-x, and for AMD โ€” SVM or AMD-V. By default, in the BIOS of many motherboards, this function may be disabled, which will make starting the emulator impossible or extremely slow.

To check the status of virtualization in Windows, open the Task Manager, go to the โ€œPerformanceโ€ tab and look at the status of the โ€œVirtualizationโ€ line. If it says "Disabled", you will need to restart your computer, enter the BIOS and enable the appropriate option in the processor settings.

โš ๏ธ Warning: If you have a third-party hypervisor installed (for example, VirtualBox or VMware), it may conflict with the Android hypervisor. In such cases, you may need to disable Hyper-V or configure exceptions on the system.

Also make sure that you have sufficient free RAM installed. The emulator itself requires 2 GB of RAM for basic operation, but for modern versions of Android 12 and higher it is recommended to allocate at least 4 GB so that the interface does not slow down.

Installing SDK components and creating a device profile

After successful installation Android Studio, the next step is to download the necessary system images. Not all components are installed automatically, so manual intervention through the SDK manager is often required.

Open the window SDK Manager through the menu Tools โ†’ SDK Manager. Here you need to go to the SDK Platforms tab and select the version of Android for which you plan to develop the application. It is recommended to select images marked Google APIs or Google Playif your application requires Google services.

Then switch to the SDK Toolstab. Make sure that the component Android Emulatoris installed. If there is a checkmark next to it, but the version is out of date, update. Also here you may need to install Intel Hardware Accelerated Execution Manager (HAXM) for Intel processors, although new versions of the studio often use a built-in hypervisor.

โ˜‘๏ธ Ready SDK for work

Done: 0 / 4

When all components are loaded, you can proceed to creating a profile. Click on the icon Device Manager in the right toolbar. In the window that opens, click the button Create Deviceto launch the wizard for setting up a new virtual device.

Selecting a hardware configuration and system image

The device creation wizard will prompt you to select a physical profile from a list of preinstalled templates. You can choose a specific model, for example Pixel 6 or Nexus 5X, or create a custom configuration. For most testing tasks, it is enough to select a profile Pixel 4 or similar in characteristics.

At the next stage, you will be asked to select a system image (System Image). Here it is important to pay attention to the processor architecture. For maximum performance on modern computers, always choose images with architecture x86 or x86_64.

Using architecture images ARM is possible, but they work much slower, as they require software emulation of processor instructions. The exception is when you need to test specific native libraries compiled only for ARM.

Image type Architecture Performance Recommendation
Google Play x86_64 High The main choice for tests
Google APIs x86_64 High For tests without Play services
Default ARM64 Low Only for specific tests
Android TV x86 Average For development for TV

Pay attention to the column API Level. Choose the version of Android that matches minSdkVersion your project or is the most popular among your users according to statistics.

๐Ÿ“Š Which version of Android do you most often use for tests?
Android 10
Android 11
Android 12
Android 13 and higher

Fine-tuning emulator parameters AVD

At the final step of the setup wizard, a detailed configuration window opens where you can change the hardware parameters of the virtual device. Do not ignore this step, as the default settings are not always optimal.

Click the button Show Advanced Settings at the bottom of the window. Here you will find the section Memory and Storage. By default, the emulator is allocated 2048 MB of RAM. If your computer has 16 GB of RAM or more, it makes sense to increase this value to 4096 MB for smoother operation of heavy applications.

You can also adjust the size of the internal memory and SD memory card in this section. Increasing the amount of internal memory may be necessary if you are testing applications that work with a large amount of cache or offline data.

In the Emulated Performance section, make sure that the value Graphics . This will shift the task of rendering the interface to your computer's video card, which is critical for smooth animations. Hardware - GLES 2.0/3.0is selected in the item

๐Ÿ’ก

If the emulator is slow, try changing the graphics mode to "Software - GLES 2.0". This will reduce the load on the video card, but may increase the load on the processor.

The camera settings deserve special attention. You can choose camera emulation, a computer webcam, or disable the camera altogether if it is not needed for tests. To test the QR code scanning functions, be sure to select a real webcam.

Launch, control and basic hotkeys

After saving the configuration, the device will appear in the list Device Manager. The launch is carried out by pressing the Play button in the line with the device. The first launch may take several minutes, as the system performs initial setup and optimization of applications.

The emulator is controlled using both the mouse and the keyboard. However, some physical smartphone buttons (Home, Back, Menu) are emulated by keyboard shortcuts. Knowing these combinations significantly speeds up the debugging process.

  • ๐Ÿ”™ Back: Key Esc or combination Ctrl + Left Arrow
  • ๐Ÿ  Home: Key F2 or Ctrl + H
  • ๐Ÿ”‹ Power: Key F3 or Ctrl + P
  • ๐Ÿ”Š Volume up/down: Keys F5 / F6
  • ๐Ÿ“ธ Camera: Key F8 or Ctrl + K

Also on the side panel of the emulator there are buttons for rotating the screen, changing orientation and accessing additional functions, such as location emulation (GPS) and battery level.

โš ๏ธ Attention: The emulator interface may vary depending on the version of Android Studio. If the hotkeys do not work, check the settings in the menu Help โ†’ Keymap.

To reboot the device in the emulator, it is not necessary to press the power button with a long tap. You can simply close the emulator window and launch it again, or use the reboot command via ADB.

Optimizing performance and troubleshooting problems

Even with proper settings, the emulator may be slow. One common reason is a lack of host system resources. Close unnecessary applications, especially browsers with many tabs, to free up RAM.

Another important aspect is usage Quick Boot. This feature allows you to save the state of the emulator when closing (similar to sleep mode on a laptop). The next time you start, the system boots in a few seconds instead of minutes.

How to enable Cold Boot Now?

If the emulator behaves strangely after updating, select the "Cold Boot Now" action in the device action menu (three dots to the right of the device name). This will perform a hard reboot and clear the cache.

If you encounter the error EMULATOR: x86 emulation currently requires hardware accelerationit means that virtualization is not enabled in the BIOS or the HAXM drivers are not installed correctly. Try reinstalling the HAXM component via SDK Manager.

For advanced users, the ability to launch the emulator via the command line with additional flags is available. For example, the flag -no-snapshot causes the emulator to boot from a clean state each time, ignoring saved snapshots.

emulator -avd Pixel_4_API_30 -no-snapshot -memory 4096

Using the command line gives more control over the process, but requires knowing the exact name of your virtual device (AVD name).

๐Ÿ’ก

Using x86_64 images and enabling hardware graphics acceleration (GLES) - two main factors for the high performance of the emulator.

Frequently asked questions (FAQ)

Why does the emulator run very slowly, even on a powerful PC?

Most often the problem lies in using an ARM image instead of x86, not having virtualization enabled in the BIOS, or allocating too little RAM memory. Also check if you are using software graphics rendering mode.

Is it possible to run multiple emulators at the same time?

Yes, Android Studio allows you to run multiple AVD instances at the same time. However, each instance consumes significant resources (minimum 2-4 GB of RAM), so make sure your computer can handle the load.

How to transfer a file from your computer to the emulator?

The easiest way is to drag the file (APK, image) from Explorer directly into the running emulator window. For APK files, the installation will start automatically, the images will open in the gallery.

Where is the emulator data stored on disk?

The data is stored in a hidden user folder. On Windows, the path usually looks like C:\Users\UserName\.android\avd. There are image files and configurations of your virtual devices.

How to reset the emulator to factory settings?

B Device Manager click on the three dots to the right of the device name and select Wipe Data. This will delete all user data and applications inside the emulator, returning it to its original state.