Warning: No DNS servers found
error whenstarting the emulator, check to see whether you have an/etc/resolv.conf
file. If you don't have this file, enter thefollowing command in a terminal window:/sdcard/Download/
directory. You canview the file from Android Studio using theDevice File Explorer, orfind it from the device using the Downloads or Files app, dependingon the device version.Feature | Description |
---|---|
Swipe the screen | Point to the screen, press and hold the primary mouse button, swipe across the screen, and then release. |
Drag an item | Point to an item on the screen, press and hold the primary mouse button, move the item, and then release. |
Tap | Point to the screen, press the primary mouse button, and then release. For example, you could click a text field to start typing in it, select an app, or press a button. |
Double tap | Point to the screen, press the primary mouse button quickly twice, and then release. |
Touch and hold | Point to an item on the screen, press the primary mouse button, hold, and then release. For example, you could open options for an item. |
Type | You can type in the emulator by using your computer keyboard, or using a keyboard that pops up on the emulator screen. For example, you could type in a text field after you selected it. |
Pressing Control (Command on Mac) brings up a pinch gesture multi-touch interface. The mouse acts as the first finger, and across the anchor point is the second finger. Drag the cursor to move the first point. Clicking the left mouse button acts like touching down both points, and releasing acts like picking both up. | |
Vertical swipe | Open a vertical menu on the screen and use the scroll wheel (mouse wheel) to scroll through the menu items until you see the one you want. Click the menu item to select it. |
Feature | Description |
---|---|
Close | Close the emulator. |
Minimize | Minimize the emulator window. |
Resize | Resize the emulator as you would any other operating system window. Theemulator maintains an aspect ratio appropriate for your device. |
Power | Click to turn the screen on or off. Click and hold to turn the device on or off. |
Volume up | Click to view a slider control and turn the volume up. Click again to turn it up more, or use the slider control to change the volume. |
Volume down | Click to view a slider control and turn the volume down. Click again to turn it down more, or use the slider control to change the volume. |
Rotate left | Rotate the device 90 degrees counterclockwise. |
Rotate right | Rotate the device 90 degrees clockwise. |
Take screenshot | Click to take a screenshot of the device. For details, see Screenshots. |
Click so the cursor changes to the zoom icon. To exit zoom mode, click the button again. Zoom in and out in zoom mode:
To pan in zoom mode, hold Control (Command on Mac) while pressing the arrow keys on the keyboard. To tap the device screen in zoom mode, Control-click (Command-click on Mac). | |
Back | Return to the previous screen, or close a dialog box, an options menu, the Notifications panel, or the onscreen keyboard. |
Home | Return to the Home screen. |
(Recent Apps) | Tap to open a list of thumbnail images of apps you’ve worked with recently. To open an app, tap it. To remove a thumbnail from the list, swipe it left or right. This button isn't supported for Wear OS. |
Fold | For foldable devices, fold the device to display its smaller screen configuration. |
Unfold | For foldable devices, unfold the device to display its larger screen configuration. |
Menu | Press Control+M (Command+M on Mac) to simulate the Menu button. |
More | Click to access other features and settings, described in the next table. |
adb emu screenrecord start --time-limit 10 [path to save video]/sample_video.webm
Screenshot_yyyymmdd-hhmmss.png
using the year, month, day, hour, minute, and second of the capture. For example,Screenshot_20160219-145848.png
.screenrecord screenshot [destination-directory]
adb emu screenrecord screenshot [destination-directory]
Feature | Description |
---|---|
Location | The emulator lets you simulate 'my location' information: the location wherethe emulated device is currently located. For example, if you click My Location in Google Maps and then send a location, the map shows it. To send a GPS location:
In decimal mode, enter a Latitude value in the range -90.0 to +90.0degrees and a Longitude value in the range -180.0 to +180.0 degrees. In sexigesimal mode, enter a three-part Latitude value in the range-90 to +90 degrees, 0 to 59 minutes, and 0.0 to 60.0 seconds. Enter aLongitude value in the range -180 to +180 degrees, 0 to 59 minutes, and0.0 to 60.0 seconds. For the latitude, - indicates south and + indicates north; for the longitude,- indicates west and + indicates east. The + is optional. Optionally specify an Altitude value in the range -1,000.0 to+10,000.0 meters. To use geographic data from a GPS exchange format (GPX) or Keyhole MarkupLanguage (KML) file:
The speed defaults to the Delay value (Speed1X). You can increase the speed by double (Speed2X), triple (Speed 3X), and so on. |
Cellular | 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, orboth:
|
Battery | 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:
|
Phone | 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:
|
Directional Pad | 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 can support the directional pad; for example, an Android watch. The buttons simulate the following actions: |
Fingerprint | 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 > Accelerometer | This control lets you test your app against changes in device position,orientation, or both. For example, you can simulate gestures such as tilt androtation. The accelerometer doesn't track the absolute position of the device:it just detects when a change is occurring. The control simulates the wayaccelerometer and magnetometer sensors would respond when you move or rotate areal device. You must enable the accelerometer sensor in yourAVD to use this control. The control reports TYPE_ACCELEROMETER events on the x, y, and z axis. These values include gravity. For example, ifthe device is suspended in outer space, it would experience zero acceleration(all of x, y, and z will be 0). When the device is on Earth and laying screen-upon top of a table, the acceleration is 0, 0, and 9.8 because of gravity.The control also reports TYPE_MAGNETIC_FIELD events, which measure the ambient magnetic field on the x, y and z axis inmicroteslas (μT).To rotate the device around the x, y, and z axes, select Rotate and do one of the following:
See Computing the device's orientationfor 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 changeaccordingly. These are the values that an app can access. For more information about these sensors, seeSensors overview,Motion sensors, andPosition sensors. You can import the AccelerometerPlay app to try out the Accelerometer control.Select File >New >Import Sample and selectthe app in the dialog. This app isshowcased in the emulator video on this page. |
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, seeSensors overview,Position sensors, andEnvironment sensors. |
Snapshots | See Snapshots. |
Screen record | See Screen recording. |
Settings > General |
|
Settings > Proxy | By default, the emulator uses the Android Studio HTTP proxy settings, but this screen allows you to manually define an HTTP proxy configuration for the emulator. For more information, see Using 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 Mac). 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, see how to report emulator bugs. |
Help > About | See which adb port the emulator uses, as well as the Android and emulator version numbers. Compare the latest available emulator version with your version to determine if you have the latest software installed. The emulator serial number is emulator-adb_port, which you can specify as an adb command line option, for example. |
-feature -Wifi
.