You might need to test your app on a virtual device using more than just basic touch screen gestures and phone movements. For example, you might want to simulate different locations or network conditions. This page covers advanced emulator features and different ways to launch the emulator with Android Studio.
The other pages in this section cover even more advanced ways to use the emulator, which require you to use the terminal. These more specialized use cases are:
- If you aren’t using Android Studio, you can start the emulator from the command line.
- To test features including fingerprint validation, or to change your virtual device’s battery state, you can send emulator console commands.
- To have two emulator instances that can communicate to each other, or to set up other complex network architectures, you can set up emulator networking.
For most app developers, the basic emulator navigation capabilities and the features on this page cover your testing needs. For a side-by-side comparison of what you can do with the emulator depending on how you interact with it, see the emulator feature comparison.
To take a screenshot of the virtual device, click the Take screenshot button.
In the Screen Capture dialog that appears, you can recapture, edit, or copy
the captured image. Once you're satisfied with the image, click Save. The
emulator creates a PNG file with the name
Screenshot_yyyymmdd-hhmmss.png, using the year, month,
day, hour, minute, and second of the capture. You can change the name, if you prefer, and
choose where to save the file.
You can also take screenshots from the command line with either of the following commands:
screenrecord screenshot [destination-directory]
adb emu screenrecord screenshot [destination-directory]
You can record video and audio from the Android Emulator and save the recording to a WebM or animated GIF file.
The screen recording controls are in the Record and Playback tab of the Extended Controls window.
Tip: You can open the screen recording controls by pressing Control+Shift+R (Command+Shift+R on macOS).
To begin screen recording, click the Start recording button in the Record and Playback tab. To stop recording, click Stop recording.
Controls for playing and saving the recorded video are at the bottom of the Record and Playback tab. To save the video, choose WebM or GIF from the menu at the bottom of the tab and click Save.
You can also record and save a screen recording from the emulator using the following command on the command line:
adb emu screenrecord start --time-limit 10 [path to save video]/sample_video.webm
The emulator supports the use of basic camera functionality on your virtual device for earlier Android versions. Android 11 and higher supports the following additional Android Emulator camera capabilities:
- RAW capture
- YUV reprocessing
- Level 3 devices
- Logical camera support
- Emulating sensor orientation by using data from the sensor manager
- Applying video stabilization by reducing handshake frequency
- Applying edge enhancement by removing the upscaling usually done in the YUV pipeline
- Concurrent cameras
Virtual scene camera and ARCore
You can use the virtual scene camera in a virtual environment to experiment with augmented reality (AR) apps made with ARCore.
For information on using the virtual scene camera in the emulator, see Run AR apps in Android Emulator.
When using the emulator with a camera app, you can import an image in PNG or JPEG format to be used within a virtual scene. To choose an image for use in a virtual scene, open the Extended controls window, select the Camera > Virtual scene images tab, and click Add image. This feature can be used to import custom images such as QR codes for use with any camera-based app. For more information, see Add Augmented Images to the scene.
Test common AR actions with macros
You can greatly reduce the time it takes to test common AR actions by using the preset macros in the emulator. For example, you can use a macro to reset all the device's sensors to their default state.
Before using macros, follow the steps in Run AR apps in Android Emulator to set up the virtual scene camera for your app, run your app on the emulator, and update ARCore. Then, follow these steps to use emulator macros:
- With the emulator running and your app connected to ARCore, click More in the emulator panel.
- Select Record and Playback > Macro Playback.
Choose a macro that you want to use, then click Play.
During playback, you can interrupt a macro by clicking Stop.
Launch the emulator in a separate window
The Android Emulator runs inside Android Studio by default. This lets you use screen space efficiently, navigate quickly between the emulator and the editor window using hotkeys, and organize your IDE and emulator workflow in a single application window.
However, some emulator features are only available when you run it in a separate window. To launch the emulator in a separate window, go to File > Settings > Tools > Emulator (Android Studio > Preferences > Tools > Emulator on macOS) and deselect Launch in a tool window.
Extended controls, settings, and help
Use the extended controls to send data, change device properties, control apps, and more. To open the Extended controls window, click More in the emulator panel. Note that some of these extended control options are only available when you run the emulator in a separate window, outside of Android Studio.
You can use keyboard shortcuts to perform many of these tasks. For a complete list of shortcuts in the emulator, press F1 (Command+/ on macOS) to open the Help pane.
The emulator lets you simulate "my location" information: where the emulated device is located. For example, if you click My Location in Google Maps and then send a location, the map shows it.
Controls for the device's location information are organized under two tabs: Single points and Routes.
In the Single points tab, you can use the Google Maps webview to search for points of interest, just as you would when using Google Maps on a phone or in a browser. When you search for (or click) a location in the map, you can save the location by selecting Save point near the bottom of the map. All your saved locations are listed on the right side of the Extended controls window.
To set the emulator's location to the location you have selected on the map, click the Set location button near the bottom right of the Extended controls window.
Similar to the Single points tab, the Routes tab provides a Google Maps webview that you can use to create a route between two or more locations. To create and save a route, do the following:
To simulate the emulator following the route you saved, select the route from the list of Saved routes and click Play route near the bottom right of the Extended controls window. To stop the simulation, click Stop route.
To continuously simulate the emulator following the specified route, enable the switch next to Repeat playback. To change how quickly the emulator follows the specified route, select an option from the Playback speed menu.
Import GPX and KML data
To use geographic data from a GPS exchange format (GPX) or Keyhole Markup Language (KML) file:
The speed defaults to the Delay value (Speed 1X). You can increase the speed by double (Speed 2X), triple (Speed 3X), and so on.
The emulator allows you to deploy your app to multiple displays, which support customizable dimensions and can help you test apps that support multi-window and multi-display. While a virtual device is running, you can add up to two additional displays as follows:
The emulator lets you simulate various network conditions. You can approximate the network speed for different network protocols, or you can specify Full, which transfers data as quickly as your computer allows. Specifying a network protocol is always slower than Full. You can also specify the voice and data network status, such as roaming. The defaults are set in the AVD.
Select a Network type:
Select a Signal strength:
Select a Voice status, Data status, or both:
You can simulate the battery properties of a device to see how your app performs under different conditions. To select a Charge level, use the slider control.
Select a Charger connection value:
Select a Battery health value:
Select a Battery status value:
|Camera||You can load pictures into the scene that is simulated when you open the emulator camera. For more information, see Add Augmented Images to the scene in the ARCore documentation.|
The emulator lets you simulate incoming phone calls and text messages.
To initiate a call to the emulator:
To send a text message to the emulator:
If the AVD has the directional pad enabled in the hardware profile, you can use the directional pad controls with the emulator. However, not all devices support the directional pad; for example, Android watches don't. The buttons simulate the following actions:
|Microphone||When Virtual microphone uses host audio input is turned on, the emulator receives audio input from the host microphone; otherwise, the emulator doesn't receive any audio input. The Virtual headset plug inserted, Virtual headset has microphone, and Voice Assist options are currently unimplemented.|
This control can simulate 10 different fingerprint scans. You can use it to test fingerprint integration in your app. This feature is disabled for Android 5.1 (API level 22) and lower and for Wear OS.
To simulate a fingerprint scan on the virtual device:
|Virtual sensors > Device Pose||
This control lets you test your app against changes in device position, orientation, or both. For example, you can simulate gestures such as tilt and rotation. The accelerometer doesn't track the absolute position of the device: it just detects when a change is occurring. The control simulates the way accelerometer and magnetometer sensors would respond when you move or rotate a real device.
You must enable the accelerometer sensor in your AVD to use this control.
The control reports
The control also reports
To rotate the device around the x, y, and z axes, select Rotate and do one of the following:
See Compute the device's orientation for more information about how yaw, pitch, and roll are calculated.
To move the device horizontally (x) or vertically (y), select Move and do one of the following:
To position the device at 0, 90, 180, or 270 degrees:
As you adjust the device, the Resulting values fields change accordingly. These are the values that an app can access.
For more information about these sensors, see Sensors overview, Motion sensors, and Position sensors.
|Virtual sensors > Additional sensors||
The emulator can simulate various position and environment sensors. It lets you adjust the following sensors so you can test them with your app:
For more information about these sensors, see Sensors overview, Position sensors, and Environment sensors .
|Bug report||If you're experiencing issues with the emulator, you can prepare and send a bug report. The emulator automatically collects screenshots, logs, and other data for the bug report.|
|Record and Playback||See Screen recording.|
|Google Play||When the AVD system image includes the Play Store app, this displays the Google Play services version information.|
|Settings > General||
|Settings > Proxy||
By default, the emulator uses the Android Studio HTTP proxy settings. This screen lets you manually define an HTTP proxy configuration for the emulator. For more information, see Use the emulator with a proxy.
|Settings > Advanced||
|Help > Keyboard Shortcuts||
This pane provides a complete list of keyboard shortcuts for the emulator. To open this pane while working in the emulator, press F1 (Command+/ on macOS).
For the shortcuts to work, the Send keyboard shortcuts option in the General settings pane must be set to Emulator controls (default).
|Help > Emulator Help||
To go to the online documentation for the emulator, click Documentation.
To file a bug against the emulator, click Send feedback. For more information, learn how to report emulator bugs.
|Help > About||
The emulator serial number is emulator-adb_port,
which you can specify as an
Launch the emulator without launching an app
Sometimes you might want to launch the emulator without running an app, such as if you want to see how two emulator devices interact with each other when paired over Bluetooth. To launch the emulator without launching an app, follow these steps:
- Open the Device Manager.
- Double-click an AVD or select an AVD and click Run . The Android Emulator loads.
While the emulator is running, you can run Android Studio projects and choose the emulator as the target device. You can also install one or more APKs onto the emulator, as described in the following section, and then run them.
Install and add files
If you want to use an app that's not available in the Google Play Store on the emulator, you can manually install the APK file. To install an APK file on the emulated device, drag an APK file onto the emulator screen. An APK Installer dialog appears. When the installation completes, you can view the app in your apps list.
To add a file to the emulated device, drag the file onto the emulator screen.
The file is placed in the
/sdcard/Download/ directory. You can
view the file from Android Studio using the
Device File Explorer or
find it from the device using the Downloads or Files app,
depending on the device version.
A snapshot is a stored image of an AVD that preserves the entire state of the device at the time that it was saved – including OS settings, application state, and user data. You can return to a saved system state by loading a snapshot, saving you the time of waiting for the operating system and applications on the virtual device to restart, as well as saving you the effort of bringing your app back to the state at which you want to resume your testing. Starting a virtual device by loading a snapshot is much like waking a physical device from a sleep state, as opposed to booting it from a powered-off state.
For each AVD, you can have one Quick Boot snapshot and any number of general snapshots.
The simplest way to take advantage of snapshots is to use a Quick Boot snapshot. By default, each AVD is set to automatically save a Quick Boot snapshot on exit and load from a Quick Boot snapshot on start.
The first time that an AVD starts, it must perform a cold boot, just like powering on a device. If Quick Boot is enabled, all subsequent starts load from the specified snapshot, and the system is restored to the state saved in that snapshot.
Snapshots are valid for the system image, AVD configuration, and emulator features they are saved with. When you make a change in any of these areas, all snapshots of the affected AVD become invalid. Any update to the Android Emulator, system image, or AVD settings resets the AVD's saved state, so the next time you start the AVD, it must perform a cold boot.
Most controls for saving, loading, and managing snapshots are in the Snapshots and Settings tabs in the Snapshots pane. If you're running the emulator in a tool window in Android Studio, the Snapshots pane button is in the emulator toolbar. If you're running the emulator in a standalone window outside of Android Studio, the Snapshots pane is in the Extended controls window.
You can also control the Quick Boot options when starting the emulator from the command line.
Save Quick Boot snapshots
You can specify whether the emulator automatically saves a snapshot when you close. To control this behavior, proceed as follows:
- Open the snapshots settings. If the emulator is embedded in Android Studio, click on Snapshots in the toolbar. If the emulator is in a separate window, open the Extended controls window.
- In the Snapshots category of controls, navigate to the Settings tab.
Use the Auto-save current state to Quickboot menu to select one of the following options:
Yes: Always save an AVD snapshot when you close the emulator. This is the default.
No: Don't save an AVD snapshot when you close the emulator.
Your selection applies only to the AVD that is currently open. You can't save snapshots while ADB is offline (such as while the AVD is still booting).
Save general snapshots
Whereas you can only have one Quick Boot snapshot for each AVD, you can have multiple general snapshots for each AVD.
To save a general snapshot, open the Snapshots pane and click the Take snapshot button in its lower-right corner.
To edit the name and description of the selected snapshot, click the edit button at the bottom of the pane.
Delete a snapshot
To manually delete a snapshot, open the Snapshots pane, select the snapshot, and click the delete button at the bottom of the pane.
You can also specify whether you would like the emulator to automatically delete snapshots when they become invalid, such as when the AVD settings or emulator version change. By default, the emulator asks you whether you want it to delete invalid snapshots. You can change this setting with the Delete invalid snapshots menu in the Settings tab of the Snapshots pane.
Load a snapshot
To load a snapshot at any time, open the emulator's Snapshots pane, select the Snapshots category, choose a snapshot, and click the load button at the bottom of the pane.
In Android Studio 3.2 and higher, each device configuration includes a Boot option control in the advanced settings in the Virtual Device Configuration dialog. You can use the control to specify which snapshot to load when starting that AVD.
Disable Quick Boot
If you want to disable Quick Boot so your AVD always performs a cold boot, do the following:
- Select Tools > Device Manager and click Edit this AVD .
- Click Show Advanced Settings and scroll down to Emulated Performance.
- Select Cold boot.
Cold boot once
Instead of disabling Quick Boot completely, you can cold boot once by clicking Cold Boot Now from the AVD's menu in the Device Manager.
Snapshot requirements and troubleshooting
- Snapshots don't work with Android 4.0.4 (API level 15) or lower.
- Snapshots don't work with ARM system images for Android 8.0 (API level 26).
- If the emulator fails to boot from a snapshot, select Cold Boot Now for the AVD in the Device Manager and submit a bug report.
- Snapshots are not reliable when software rendering is enabled. If snapshots don't work, click Edit this AVD in the Device Manager and change Graphics to either Hardware or Automatic.
- Loading or saving a snapshot is a memory-intensive operation. If you don't have enough RAM free when a load or save operation begins, the operating system may swap the contents of RAM to the hard disk, which can greatly slow the operation. If you experience very slow snapshot loads or saves, you may be able to speed these operations by freeing RAM. Closing applications that are not essential for your work is a good way to free RAM.
When using an AVD with API level 25 or higher, the emulator provides a simulated Wi-Fi access point ("AndroidWifi"), and Android automatically connects to it.
You can disable Wi-Fi in the emulator by running the emulator with the
The Android Emulator doesn't include virtual hardware for the following:
- SD card insert/eject
- Device-attached headphones
The watch emulator for Wear OS doesn't provide the Overview (Recent Apps) button, D-pad, or fingerprint sensor.