Development of mobile applications for the platform Android requires a test environment where you can check the functionality of the code without the risk of โ€œbrickingโ€ the physical device. For these purposes, Google engineers have introduced a powerful tool - Android Virtual Device, which allows you to run a full-fledged OS directly on your computer. Installing AVD is the first critical step in setting up the working environment of any developer.

Many beginners encounter difficulties already at the stage of downloading the necessary system images or selecting the correct hardware settings for the emulator. Incorrect configuration can cause the virtual machine to run slowly or not start at all. In this article, we will analyze in detail the integration process AVD Manager into your development environment so that you can immediately start writing code.

We will consider not only standard installation scenarios, but also the nuances associated with hardware virtualization and the choice of processor architecture. Understanding these aspects will help you avoid common mistakes and save time when debugging applications.

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. Android Studio itself is a resource-intensive application, and running a virtual machine on top of it creates additional load on the processor and RAM. It is recommended to have at least 8 GB of RAM, although for modern projects the best option would be 16 GB or more.

A key component for fast operation of the emulator is support for hardware virtualization. On processors Intel this technology is called VT-x, and on AMD โ€” AMD-V. Without enabling this feature in the BIOS/UEFI, the emulator will either not start or will work in software emulation mode, which is unacceptably slow for modern development.

โš ๏ธ Attention: If you see an error related to HAXM or WHPX when starting the emulator, first check your computer's BIOS settings. Often this option is disabled by default on new motherboards.

It is also worth checking the availability of free disk space. System images take up a significant amount of space, and during operation the emulator creates cache files and user data. One device may require from 2 to 10 GB of free space depending on the version Android.

๐Ÿ“Š What processor is installed in your PC?
Intel Core i5/i7/i9
AMD Ryzen
Apple Silicon (M1/M2/M3)
Other / I donโ€™t know

Installing components via SDK Manager

The process of installing tools for working with virtual devices takes place internally Wednesday Android Studio. You don't need to download individual executable files from third-party resources. All necessary components are managed through the built-in package manager, which guarantees version compatibility.

To begin, open the tools menu and find the SDK management section. All installed platforms, build tools, and system images are displayed here. We are interested in the tab responsible for system images, since they contain the โ€œfirmwareโ€ for the future emulator.

Follow the algorithm of actions to download the necessary files:

  • ๐Ÿ“ฆ Launch SDK Manager through the menu Tools โ†’ SDK Manager.
  • ๐Ÿ“‚ Go to tab SDK Platforms and select the desired version of Android (the latest stable version is recommended).
  • ๐Ÿ“ฅ Switch to the tab SDK Tools and make sure that the item is checked Android Emulator.
  • ๐Ÿ’พ Press the button Apply to start downloading and installation components.

After installation is complete, you will have a complete set of tools at your disposal for generating virtual devices. It is important to note that downloading images may take some time depending on the speed of the Internet connection, since the files weigh several gigabytes.

๐Ÿ’ก

If the download freezes or is very slow, check the proxy settings in Android Studio or try changing the download source in the SDK Manager settings to a mirror close to your region.

Creating a new virtual device in AVD Manager

When all components are installed, you can proceed to the actual creation of the device. To do this, in the main window of the development environment there is a special control panel that allows you to configure hardware and software parameters.

Click on the device icon in the top toolbar to open the window Device Manager. In the list that appears, you will see previously created devices (if any) and a button to add a new one. Clicking on Create Device will launch a setup wizard that will guide you through several configuration steps.

The first step is selecting a hardware profile. Here is a list of preset configurations that simulate real smartphones and tablets. You can choose a popular model, for example Pixel 6 or Galaxy S22to test the application in conditions as close as possible to reality.

Parameter Description Recommendation
Phone Smartphones with different screen sizes Choose models with a cutout or hole for the camera to check the UI
Tablet Tablets with a large screen Necessary for testing adaptive layout
Desktop Devices with a large screen (Foldable) For testing folding devices and multi-window mode
Wear OS Smart watches Only if you are developing an application for wearable electronics
TV Android TV set-top boxes For applications for large screens and remote controls DU

After selecting the form factor, click Nextto proceed to selecting the system image. At this point, you will be asked to download or select an already downloaded version of the operating system. Pay attention to the image type column: for best performance on x86 PCs, you should select images marked Google APIs or Google Play.

โ˜‘๏ธ Check before creating AVD

Completed: 0 / 4

Configuring the emulator hardware parameters

The final stage before launchโ€”detailed configuration of the virtual device. Many users leave the default settings, but specific tasks may require manual intervention in the memory and graphics settings.

In the configuration confirmation window, click on the link Show Advanced Settingsto expand the full list of parameters. Here you can change the amount of RAM allocated to the emulator, the number of processor cores and the size of internal memory.

Pay special attention to the section Emulated Performance. The smoothness of the interface and the speed of drawing animations depend on the graphics rendering mode. The default mode is Automatic, which tries to select the best option, but sometimes manual selection gives the best result.

โš ๏ธ Attention: Do not allocate all available computer memory to the emulator. Leave at least 4 GB for the host operating system and other background processes to work, otherwise the computer will begin to slow down greatly.

Also in the advanced settings, you can emulate various camera characteristics, position sensors, and even the network with a given speed and latency. This is useful for testing the behavior of the application in conditions of poor connection or in the absence of a GPS signal.

What is Cold Boot Now?

This option completely reboots the emulator, ignoring the saved state (snapshot). Use it if the emulator behaves incorrectly or you have installed new system updates that were not applied during quick startup.

Starting the emulator and the first steps in work

After pressing the button Finish the new device will appear in the list Device Manager. You can launch it by double-clicking or by clicking on the โ€œPlayโ€ icon in the line with the device name. The loading process will take some time, especially during the first launch, when the system is performing the initial setup.

The emulator window is a separate application that can be scaled and moved around the desktop. The right panel contains control buttons: changing the volume, rotating the screen, calling up the power menu and emulating location. These tools are indispensable for debugging.

You can use console commands to check the connection between the computer and the emulator. Open a terminal inside Android Studio and enter the command to check the connected devices:

adb devices

Your virtual device status should be displayed in the list device. This means that USB debugging is successfully emulated and you can install applications with the command adb install or by running the project directly from the IDE.

๐Ÿ’ก

Using the "Snapshot" function allows you to save the state of the emulator and return to it instantly, which significantly speeds up the process of testing repetitive scenarios.

Solving common problems and errors

During the operation of AVD, users often encounter a number of typical problems. Understanding the reasons for their occurrence will help you quickly restore the functionality of your development environment without reinstalling the entire package.

One โ€‹โ€‹of the most common problems is a black screen at startup or freezing at the logo. This is often due to a graphics driver incompatibility or a bug in the rendering settings. Try changing the setting Graphics to Software - GLES 2.0 in the device configuration.

Another common error is a message about low disk space. The emulator stores user data in a special folder, which can grow over time. Clearing data through the emulator menu or deleting the device and then creating a new one solves this problem.

  • ๐ŸŒ Poor performance: Make sure that the image is x86_64, not ARM, and hardware virtualization is enabled.
  • โŒ Installation error: Check if the antivirus is blocking emulator processes or files in SDK folder.
  • ๐Ÿ”Œ ADB does not see the device: Restart the debug server with the command adb kill-server and then adb start-server.

If all else fails, try resetting the emulator to factory settings via menu Wipe Data in the device manager. This will remove all installed applications and files, but will return the system to a clean state.

Is it possible to run the emulator without Android Studio?

Yes, command line tools avdmanager and emulator allow you to create and run devices regardless of the IDE. However, for most developers, using the Android Studio graphical interface is more convenient and clearer.

Why does the emulator run slowly on a powerful PC?

Most often, the reason is disabled virtualization in the BIOS or using an ARM architecture image on an Intel/AMD processor. Emulating an ARM instruction on x86 requires significant CPU resources.

How to emulate different versions of Android on one device?

You need to create several virtual devices with different System Images. Each device will have its own version of the OS, but can use the same hardware profile.

Where is the emulator data stored on disk?

By default, the data is stored in the user directory: on Windows it C:\Users\YourUser\.android\avd, on macOS and Linux - in a hidden folder .android/avd in the home folder directory.

Is it possible to test applications using Google Play Services?

Yes, to do this, when creating a device, you need to select a system image marked Google Play in the Play Store column. Regular Google APIs images contain services, but do not have an application store.