Android Studio is the industry standard for mobile application development, and an integral part of it is the built-in emulation tool. This software package allows you to run virtual devices directly on your computer, simulating the behavior of real smartphones and tablets. For novice developers, this is an indispensable tool that eliminates the need to buy many physical gadgets for testing.
The installation process of the emulator is tightly integrated into the development environment, which makes it available immediately after installing the main package. However, proper configuration requires attention to details, such as the choice of processor architecture and operating system version. Errors at the setup stage can lead to slow operation of the virtual machine or a complete failure of the system to start.
In this material we will analyze in detail all the stages of creating a virtual device, from launching the manager to fine-tuning hardware parameters. You'll learn how to avoid common performance problems and which system images are best suited for various testing tasks. Proper setup of the emulator will save you hours of time in the future.
Preparing the development environment and checking requirements
Before you start creating a virtual device, you need to make sure that your computer meets the minimum system requirements. Android emulation is a resource-intensive process that puts a strain on both the CPU and RAM. Insufficient resources will cause the interface to operate with noticeable delays, making testing impossible.
A critical component is support for virtualization technologies at the BIOS or UEFI level of your motherboard. For Intel processors this is technology VT-x, and for AMD - SVM or AMD-V. Without enabling this function in the BIOS settings, the emulator will either not start at all or will work in extremely slow software mode.
You should also check the availability of free space on your hard drive. System images occupy a significant amount of space, and during operation the emulator creates user data files, the size of which can reach several gigabytes. It is recommended to have at least 10 GB of free space solely for the needs of virtual devices.
โ ๏ธ Attention: If you use a laptop in power saving mode, the performance of the emulator may be artificially limited. Switch the power plan to "High Performance" mode before starting work.
Launch AVD Manager and create a new device
The tool for managing virtual devices is called AVD Manager (Android Virtual Device). You can access it through the top menu of the development environment or through the toolbar. After launching the manager window, you will see a list of already created devices, if any, and a button to add a new one.
At the first stage of the creation wizard, you will be asked to select the physical model of the device. The list includes popular screen configurations and form factors, from compact phones to large tablets. You can choose a ready-made profile, for example Pixel 6 or Nexus 5X, or create your own configuration with a unique resolution.
Particular attention should be paid to screen parameters and pixel density. Choosing these settings incorrectly can distort the layout of your application, making interface elements too small or large. For most modern tasks, it is recommended to choose profiles with a high pixel density, as they better reflect the real picture on modern displays.
Selecting a system image and processor architecture
After selection "hardware" comes the stage of choosing an operating system. In the image download window you will see a list of available Android versions, from the oldest to the latest releases. Each version may have several assemblies that differ in API level and the presence of Google services.
The key point here is choosing the right processor architecture. For maximum performance on modern computers, you need to select images marked Google APIs or Google Playthat are built on the architecture x86 or x86_64. These images use hardware virtualization of your host processor, which ensures smooth operation.
Avoid using tagged images ARMunless you have a specific need to test code that depends on that architecture. Emulation of ARM instructions on an x86 processor occurs in software, which reduces the speed of the device by tens of times. This is only valid for highly specialized tests.
| Image type | Architecture | Performance | Purpose |
|---|---|---|---|
| Google APIs | x86_64 | High | Basic development |
| Google Play | x86_64 | High | Testing Google services |
| Android TV | x86 | Average | Development for TV |
| Standard | ARM | Low | Specific tests |
If the required system image is not in the list, click on the โDownloadโ link next to the Android version name. The download manager will open, where you can select a specific release and Google APIs package.
Configuring virtual machine hardware parameters
On the final screen, before starting, the wizard offers to check and change the hardware configuration. Here you can manually set the amount of RAM allocated for the emulator and the number of processor cores. By default, the system offers safe values, but they can be increased to speed up operation.
In the โGraphicsโ section, it is recommended to select mode Hardware - GLES 2.0 or higher. This will allow you to transfer the task of drawing the interface to your computerโs video card using OpenGL technologies. Software rendering (Software) heavily loads the central processor and is not suitable for testing graphics or animations.
Also in this menu you can configure the internal memory and SD memory card. Increasing the amount of internal memory may be necessary if your application runs on large files or caches. However, you should not allocate too many resources so as not to leave the main system without the necessary memory.
โ๏ธ Checking the AVD configuration
Starting the emulator and initial initialization
After clicking the โFinishโ button, the new device will appear in the AVD Manager list. To start it, just click the green โPlayโ button in the line with the device name. A separate window will open in which the process of loading the Android operating system will begin.
The first launch always takes longer than subsequent ones, since the system needs to unpack the image and carry out the initial setup. You will see the Android logo followed by a boot animation. If the process hangs at the logo for more than 5 minutes, there may be a problem with the BIOS virtualization settings.
After a successful boot, you will see the standard lock screen or desktop, depending on the system version. Now the emulator is completely ready to install applications from Android Studio or via Drag-and-Drop APK files. The device is controlled by the mouse, and text is entered using the computer keyboard.
โ ๏ธ Attention: When you first launch some system images, you may need to connect to the Internet to activate Google services. Make sure your computer has a stable network connection.
Managing system status and snapshots
The Android Studio emulator has a powerful feature for creating state snapshots (Snapshots). This feature allows you to save the current state of the virtual device, including all installed applications and data, and instantly restore it the next time it is launched.
Using snapshots significantly speeds up the developer's workflow. Instead of waiting for the system to fully boot and re-configuring your environment, you can be back up and running in a few seconds. This is especially useful when debugging specific scenarios for using the application.
You can manage pictures through the emulator menu or in the AVD Manager settings. You can create multiple restore points for different stages of testing. However, it is worth remembering that each snapshot takes up additional disk space, so old versions should be periodically deleted.
Where are the emulator files stored?
Virtual device files are stored in the user directory by default. On Windows, the path usually looks like C:\Users\UserName\.android\avd. On macOS and Linux they are located in the hidden ~/.android/avd folder. Knowing this path is useful for manual backup or freeing up disk space.
Advanced settings and debugging via the console
For advanced users, the ability to control the emulator via the command line is available. The tool adb (Android Debug Bridge) allows you to send commands directly to a virtual device, install applications, take logs and emulate various network conditions.
Using the console, you can change geolocation, battery level and network connection type on the fly. This is an indispensable tool for testing application behavior under extreme conditions, such as a weak network signal or low battery power.
adb -e emu geo fix 37.6176 55.7558
This command, for example, sets the emulator coordinates to the center of Moscow. Such manipulations allow you to check the operation of maps and geoservices without the need for physical movement. The flexibility of settings makes the emulator a powerful tool not only for development, but also for deep testing.
Using the ADB command line gives access to emulator functions that cannot be called through the graphical interface, which is critical for complex testing.
Why does the emulator run slowly even on a powerful PC?
Most often, the reason lies in disabled virtualization in the BIOS or using an ARM architecture system image instead of x86. Also check if other heavy apps are running that consume RAM.
How to change the screen resolution in a running emulator?
Changing the resolution on the fly is difficult; it is easier to create a new virtual device with the necessary parameters in AVD Manager. However, you can try using ADB commands to change the screen density (dpi), which will visually change the scale of the interface.
Is it possible to run multiple emulators at the same time?
Yes, Android Studio allows you to run multiple virtual devices in parallel. This is useful for testing interaction between devices, but requires significant computer resources: multiply the requirements of one emulator by the number of them.
Where can I find downloaded system images if I need to free up space?
System images are stored in the SDK folder in a subdirectory system-images. You need to remove them carefully; it is better to do this through the SDK Manager in the Android Studio settings, so as not to violate the integrity of the development environment.
What to do if the emulator gives the error โHAXM is not installedโ?
This error means that the Intel hardware acceleration driver is not installed. You need to open the SDK Manager, go to the SDK Tools tab and install the component Intel x86 Emulator Accelerator (HAXM installer), then start its installation manually.