644 lines
26 KiB
Plaintext
644 lines
26 KiB
Plaintext
page.title=Running Apps in the Android Emulator
|
||
parent.title=Android Studio
|
||
parent.link=index.html
|
||
page.tags=emulator
|
||
@jd:body
|
||
|
||
<div id="qv-wrapper">
|
||
<div id="qv">
|
||
|
||
<h2>In this document</h2>
|
||
<ol>
|
||
<li><a href="#about">About the Android Emulator</a></li>
|
||
<li><a href="#runningapp">Running an App in the Android Emulator</a></li>
|
||
<li><a href="#runningemulator">Launching the Android Emulator Without Running an App</a></li>
|
||
<li><a href="#navigate">Navigating on the Screen</a></li>
|
||
<li><a href="#tasks">Performing Basic Tasks in the Emulator</a></li>
|
||
<li><a href="#extended">Working With Extended Controls, Settings, and Help</a></li>
|
||
|
||
</ol>
|
||
|
||
<h2>See also</h2>
|
||
<ol>
|
||
<li><a href="{@docRoot}tools/help/emulator.html">Android Emulator Command Line Features</a></li>
|
||
<li><a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with
|
||
AVD Manager</a></li>
|
||
</ol>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<p>The Android Emulator simulates a device and displays it on your development
|
||
computer. It lets you prototype, develop, and test
|
||
Android apps without using a hardware device. The emulator supports Android
|
||
phone, tablet, Android Wear, and Android TV devices. It comes with predefined
|
||
device types
|
||
so you can get started quickly, and you can create your own device definitions
|
||
and emulator skins.</p>
|
||
|
||
<p>The Android Emulator is fast,
|
||
powerful, and feature-rich. It can transfer information faster than using
|
||
a connected hardware device, speeding up the development process. The
|
||
multi-core feature lets the emulator take advantage of multiple core
|
||
processors on your development computer to improve emulator performance even
|
||
more.</p>
|
||
|
||
<img src="{@docRoot}images/tools/e-emulator.png" style="height:400px" alt="emulator"/>
|
||
|
||
<h2 id="about">About the Android Emulator</h2>
|
||
|
||
<p>You can launch an app on the emulator when you run your project, or you can
|
||
drag an APK file onto the emulator to install it. As with a hardware device,
|
||
after you install an app
|
||
on a virual device, it remains until you uninstall or replace it. If needed, you
|
||
can test how multiple apps, such as your own or system apps, work with each
|
||
other.</p>
|
||
|
||
<h3 id="features">Features for trying out your apps</h3>
|
||
|
||
<p>You interact with the emulator just as you would with a hardware device, but
|
||
using your mouse and keyboard, and emulator buttons and controls.
|
||
The emulator supports virtual hardware buttons and touchscreens, including
|
||
two-finger operations,
|
||
as well as directional pads (D-pads), trackballs, wheels, and various
|
||
sensors. You can dynamically resize the emulator window as needed, zoom in and
|
||
out, change the orientation, and even take a screenshot.</p>
|
||
|
||
<p>When your app is running on
|
||
the emulator, it can use the services of the Android platform to invoke other
|
||
apps, access the network, play audio and video, accept audio input,
|
||
store and retrieve data, notify the user, and render graphical transitions and
|
||
themes. The emulator has controls that let
|
||
you easily send incoming phone calls and text messages, specify
|
||
the location of the device, simulate fingerprint scans, specify network
|
||
speed and status, and simulate battery properties. The emulator can
|
||
simulate an SD card and internal data storage; you can drag a file, such as a
|
||
graphics or data file, onto the emulator to store it.</p>
|
||
|
||
<h3 id="avds">Android Virtual Device configurations</h3>
|
||
|
||
<p>The emulator uses an Android Virtual Device (AVD) configuration to determine
|
||
the look, functionality, and system image of the simulated device. AVDs let you
|
||
define certain hardware aspects of your emulated devices and allow you to create
|
||
many configurations to test different Android platforms and hardware
|
||
permutations.</p>
|
||
|
||
<p>Each AVD functions as an independent device, with its own private storage for
|
||
user data, SD card, and so on. When you launch the emulator with an AVD
|
||
configuration, it automatically loads the user data and SD card data from the
|
||
AVD directory. By default, the emulator stores the user data, SD card data, and
|
||
cache in the AVD directory.</p>
|
||
|
||
<p>To create and manage AVDs, use the
|
||
<a href="{@docRoot}tools/devices/managing-avds.html">AVD Manager</a>.
|
||
For more information, see
|
||
<a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.</p>
|
||
|
||
<h3 id="system">System images</h3>
|
||
|
||
<p>The Android Emulator runs a full
|
||
Android system stack, down to the kernel level, that includes a set of
|
||
preinstalled apps (such as the dialer) that you can access from your
|
||
apps. You can choose which version of the Android system you want to
|
||
run in the emulator when creating AVDs.
|
||
</p>
|
||
|
||
<p>The Android system images available through the AVD Manager contain
|
||
code for the Android Linux kernel, the native libraries, the VM, and the
|
||
various Android packages (such as the Android framework and preinstalled
|
||
apps).</p>
|
||
|
||
<h3 id="dependencies">Dependencies and prerequisites</h3>
|
||
<p>The Android Emulator has the following requirements:</p>
|
||
<ul>
|
||
<li>Android Studio 2.0 or higher</li>
|
||
<li>SDK Tools 25.0.10 or higher</li>
|
||
<li><a href="{@docRoot}sdk/index.html#Requirements">System
|
||
requirements</a></li>
|
||
<li>Newly created AVDs to replace any AVDs for emulator 24.0.<em>x</em> or
|
||
lower</li>
|
||
<li>Active network connection for certain operations, such as testing app
|
||
features that require it</li>
|
||
<li>adb integration enabled through <strong>Tools</strong> >
|
||
<strong>Android</strong> > <strong>Enable ADB Integration</strong>
|
||
</li>
|
||
</ul>
|
||
|
||
<h3 id="limitations">What's not supported</h3>
|
||
|
||
<p>The Android Emulator supports most features of a device, but doesn't
|
||
include virtual hardware for:</p>
|
||
<ul>
|
||
<li>WiFi</li>
|
||
<li>Bluetooth</li>
|
||
<li>NFC</li>
|
||
<li>SD card insert/eject</li>
|
||
<li>Device-attached headphones</li>
|
||
<li>USB</li>
|
||
</ul>
|
||
<p>The watch emulator for Android Wear doesn't support the Overview
|
||
(Recent Apps) button, D-pad, and fingerprint sensor.</p>
|
||
|
||
<p>While most end users of phones and tablets tend to use earlier API levels,
|
||
Android Wear and Android TV users tend to use the latest releases. Using recent
|
||
releases can give you a better experience using the emulator.
|
||
</p>
|
||
|
||
<h2 id="runningapp">Running an App in the Android Emulator</h2>
|
||
|
||
<p>You can run an app from an Android Studio project. Or, you can run an app
|
||
that's been installed on the emulator as you would run any app on a device.</p>
|
||
|
||
<p>To start the emulator and run an app in your project:</p>
|
||
<ol>
|
||
<li>Open an Android Studio project and select Run <img src="{@docRoot}images/tools/e-irun.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Run icon" />.</li>
|
||
<p>The <em>Select Deployment Target</em> dialog appears.</p>
|
||
<img src="{@docRoot}images/tools/e-selectdeploymenttarget.png"
|
||
style="height:250px" alt="Select Deployment Target dialog" />
|
||
<li>If you receive an error or warning message at the top of the dialog, click
|
||
the link to correct the problem or get more information.</li>
|
||
<p>The <strong>No USB devices or running emulators detected</strong> warning
|
||
means that you don’t currently have any emulators running, or any detected
|
||
hardware devices connected to your computer. If you
|
||
don’t have hardware devices connected to your computer, or any emulators
|
||
running, you can ignore it. </p>
|
||
<p>Some errors you must fix before you can continue, such as certain Hardware
|
||
Accelerated Execution Manager (Intel® HAXM) errors.</p>
|
||
<li>In the <em>Select Deployment Target</em> dialog, select an existing emulator
|
||
definition, and then click <strong>OK</strong>.</p>
|
||
<p>If you don’t see a definition you want to use, click <strong>Create New
|
||
Emulator</strong> to launch the AVD Manager. After you define a new AVD, in
|
||
the <em>Select Deployment
|
||
Target</em> dialog, click <strong>OK</strong>.</p>
|
||
<p>If you want to use this emulator definition as the default for your project,
|
||
select <strong>Use same selection for future launches</strong>.</p>
|
||
<p>The emulator launches and displays your app.</p>
|
||
<li>Test your app in the emulator.</li>
|
||
<p>You can use the features described in the following sections:</p>
|
||
<ul>
|
||
<li><a href="#navigate">Navigating on the Screen</a></li>
|
||
<li><a href="#tasks">Performing Basic Tasks in the Emulator</a></li>
|
||
<li><a href="#extended">Working With Extended Controls, Settings, and Help</a></li>
|
||
</ul>
|
||
<li>To close the emulator, click Close <img src="{@docRoot}images/tools/e-iclose.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Close icon" />.</li>
|
||
<p>The emulator device stores the installed app so you can run it again, if
|
||
needed. You need to uninstall an app to remove it. If you run the project
|
||
again on the same emulator, it replaces the app with the new version.</p>
|
||
</ol>
|
||
|
||
<h2 id="runningemulator">Launching the Android Emulator Without Running an App</h2>
|
||
|
||
<p>To start the emulator:</p>
|
||
<ol>
|
||
<li><a href="{@docRoot}tools/devices/managing-avds.html">Open the AVD Manager</a>.</li>
|
||
<li>Double-click an AVD, or click Run <img src="{@docRoot}images/tools/e-irun.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Run icon" />.</li>
|
||
<p>The Android Emulator appears.</p>
|
||
<p>While the emulator is running, you can run Android Studio projects and
|
||
choose the
|
||
emulator as the target device. You can also drag one or more APKs onto the
|
||
emulator to install them, and then run them.</p>
|
||
</ol>
|
||
|
||
|
||
<h2 id="navigate">Navigating on the Screen</h2>
|
||
|
||
<p>Use your computer mouse pointer to mimic your finger on the touchscreen;
|
||
select menu items and input fields; and click buttons and controls.
|
||
Use your computer keyboard to type characters and enter emulator shortcuts.</p>
|
||
<table border="0" style="clear:left;">
|
||
<tr>
|
||
<th scope="col">Feature</th>
|
||
<th scope="col">Description</th>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>Swipe the screen</td>
|
||
<td>Point to the screen, press and hold the primary mouse button, swipe
|
||
across the screen, and then release.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Drag an item</td>
|
||
<td>Point to an item on the screen, press and hold the primary mouse
|
||
button, move the item, and then release.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Tap <div>(touch)</div></td>
|
||
<td>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.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Double tap</td>
|
||
<td>Point to the screen, press the primary mouse button quickly twice,
|
||
and then release.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Touch and hold</td>
|
||
<td>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. </td>
|
||
</tr>
|
||
<tr>
|
||
<td>Type</td>
|
||
<td>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.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><nobr>Pinch and spread</nobr></td>
|
||
<td><div>Pressing Alt or Option (⌥) 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.</div>
|
||
<div>Clicking the left mouse button acts like touching down both points, and
|
||
releasing acts like picking both up.</div></td>
|
||
</tr>
|
||
</table>
|
||
|
||
<h2 id="tasks">Performing Basic Tasks in the Emulator</h2>
|
||
|
||
<p>The panel on the right side of the emulator lets you perform various tasks.
|
||
You can also drag files onto the emulator to install apps and download files.
|
||
</p>
|
||
<table border="0" style="clear:left;">
|
||
<tr>
|
||
<th scope="col">Feature</th>
|
||
<th scope="col">Description</th>
|
||
<th scope="col">Keyboard Shortcut</th>
|
||
</tr>
|
||
<tr>
|
||
<td>Close<br><img src="{@docRoot}images/tools/e-iclose.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Close icon" /></td>
|
||
<td>Close the emulator.</td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Minimize<br><img src="{@docRoot}images/tools/e-iminimize.png"
|
||
style="vertical-align:sub;margin:0;height:9px" alt="Minimize icon" /></td>
|
||
<td>Minimize the emulator window.</td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Resize</td>
|
||
<td>Resize the emulator as you would any other operating system window. The
|
||
emulator maintains an aspect ratio appropriate for your device.</td>
|
||
<td>⌘↑ and ⌘↓</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Power<br><img src="{@docRoot}images/tools/e-ipower.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Power icon" /></td>
|
||
<td>Click to turn the screen on or off.<br>Click and hold to turn the device
|
||
on or off. </td>
|
||
<td><div>Ctrl+P</div> <div>⌘P</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Volume Up<br><img src="{@docRoot}images/tools/e-ivolumeup.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Volume Up icon" /></td>
|
||
<td>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. </td>
|
||
<td><div>Ctrl+=</div><div>⌘=</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Volume Down<br><img src="{@docRoot}images/tools/e-ivolumedown.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Volume Down icon" /></td>
|
||
<td>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. </td>
|
||
<td><div>Ctrl+-</div><div>⌘-<div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Rotate Left<br><img src="{@docRoot}images/tools/e-irotateleft.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Rotate Left icon" /></td>
|
||
<td>Rotate the phone 90 degrees counterclockwise.</td>
|
||
<td><div>Ctrl+Left</div><div>⌘←</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Rotate Right<br><img src="{@docRoot}images/tools/e-irotateright.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Rotate Right icon" /></td>
|
||
<td>Rotate the phone 90 degrees clockwise.</td>
|
||
<td><div>Ctrl+Right</div><div>⌘→</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Take Screenshot<br><img src="{@docRoot}images/tools/e-itakescreenshot.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Take Screenshot icon" />
|
||
</td>
|
||
<td>Click to take a screenshot of the device. The default save location is
|
||
your computer desktop. To change the save location, select
|
||
<strong>…</strong> > <strong>Settings</strong>. The emulator creates a
|
||
file with the name <code>Screenshot_<em>yyyymmdd-hhmmss</em>.png</code>
|
||
using the year, month, day, hour, minute, and second of the capture, for
|
||
example, <code>Screenshot_20160219-145848.png</code>. </td>
|
||
<td><div>Ctrl+S</div><div>⌘S<div></td>
|
||
</tr>
|
||
<tr>
|
||
<td><nobr>Enter Zoom Mode</nobr><br><img src="{@docRoot}images/tools/e-izoom.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Enter Zoom Mode icon" />
|
||
</td>
|
||
<td><p>Click so the cursor changes to the zoom icon:</p>
|
||
<ul>
|
||
<li> Left-click the screen to zoom in by 25%, up to a maximum of about twice
|
||
the screen resolution of the virtual device.
|
||
<li> Right-click to zoom out.
|
||
<li> Left-click and drag to select a box-shaped area to zoom in on.
|
||
<li> Right-click and drag a selection box to reset to default zoom.
|
||
<li> Ctrl-click to touch the screen while in zoom mode.
|
||
</ul>
|
||
<p>Click Enter Zoom Mode again to return to normal screen size.</p></td>
|
||
<td><div>Ctrl+Z</div><div>⌘Z</div>
|
||
<div>While in zoom mode:</div>
|
||
<div>Ctrl+Up</div><div>Ctrl+Down</div>
|
||
<div>Ctrl+Shift+Up</div><div>Ctrl+Shift+Down</div>
|
||
<div>Ctrl+Shift+Left</div><div>Ctrl+Shift+Right</div>
|
||
<div>⌘↑ and ⌘↓</div>
|
||
<div>⇧⌘↑ and ⇧⌘↓</div>
|
||
<div>⇧⌘← and ⇧⌘→</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Back<br><img src="{@docRoot}images/tools/e-iback.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Back icon" /></td>
|
||
<td>Return to the previous screen, or close a dialog box, an options menu,
|
||
the Notifications panel, or the onscreen keyboard. </td>
|
||
<td><div>Ctrl+Backspace</div>
|
||
<div>⌘⌫</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Home<br><img src="{@docRoot}images/tools/e-ihome.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Home icon" /></td>
|
||
<td>Return to the Home screen. Press and hold to open the item specific to
|
||
your API level. </td>
|
||
<td><div>Ctrl+H</div><div>⌘⇧H</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td><div>Overview<br><img src="{@docRoot}images/tools/e-ioverview.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Overview icon" /></div>
|
||
<div>(Recent Apps)</div></td>
|
||
<td>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 Android Wear.</td>
|
||
<td><div>Ctrl+O</div><div>⌘O</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Menu</td>
|
||
<td>Type the keyboard shortcut to simulate the Menu button, for example,
|
||
to open the menu for the selected app.</td>
|
||
<td><div>Ctrl+M</div><div>⌘M</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>More<br><img src="{@docRoot}images/tools/e-imore.png"
|
||
style="vertical-align:sub;margin:0;height:9px" alt="More icon" /></td>
|
||
<td>Click to access other features and settings, described in the next
|
||
table.</td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Install an APK</td>
|
||
<td>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.The app didn’t install if a dialog appears that says “APK failed
|
||
to install.”</td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Add a file</td>
|
||
<td>Drag any file onto the emulator screen. It’s placed in the
|
||
<code>/sdcard/Download</code> directory. Navigate to the file using the
|
||
method for the API level. For example, for API 22, this is the navigation
|
||
path: <strong>Settings</strong> > <strong>Device: Storage & USB</strong>
|
||
> <strong>Internal Storage</strong> > <strong>Explore</strong>
|
||
(Virtual SD Card). </td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Toggle trackball mode</td>
|
||
<td></td>
|
||
<td>F6</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<h2 id="extended">Working With the Extended Controls, Settings, and Help</h2>
|
||
|
||
<p>The extended controls let you send data, change device properties, control
|
||
apps, and more. To access the controls, select <strong>…</strong> in the
|
||
emulator panel and then select the option you want in the left panel of the
|
||
<em>Extended Controls</em> dialog.</p>
|
||
|
||
<table border="0" style="clear:left;">
|
||
<tr>
|
||
<th scope="col">Feature</th>
|
||
<th scope="col">Description</th>
|
||
<th scope="col">Keyboard Shortcuts</th>
|
||
</tr>
|
||
<tr>
|
||
<td>Location</td>
|
||
<td>
|
||
<p>The emulator lets you simulate “my location” information: the location where
|
||
the emulated device is currently located. For example, if you click My Location
|
||
<img src="{@docRoot}images/tools/e-ilocation.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="My Location icon" />
|
||
in Google Maps and then send a location, the map shows it.</p>
|
||
<p>To send a GPS location:</p>
|
||
<ol>
|
||
<li> Select <strong>Decimal</strong> or <strong>Sexagesimal</strong>.</li>
|
||
<li> Specify the location.</li>
|
||
|
||
<p>In decimal mode, enter a <strong>Latitude</strong> value in the range -90.0
|
||
to +90.0 degrees and a <strong>Longitude</strong> value in the range -180.0 to
|
||
+180.0 degrees.</p>
|
||
<p>In sexigesimal mode, enter a three-part <strong>Latitude</strong> value in
|
||
the range -90 to +90 degrees, 0 to 59 minutes, and 0.0 to 60.0
|
||
seconds. Enter a <strong>Longitude</strong> value in the range -180 to +180
|
||
degrees, 0 to 59 minutes, and 0.0 to 60.0 seconds.</p>
|
||
<p>For the latitude, - indicates south and + indicates north; for the longitude,
|
||
- indicates west and + indicates east. The + is optional.</p>
|
||
<p>Optionally specify an <strong>Altitude</strong> value in the range
|
||
-1,000.0 to +10,000.0 meters.</p>
|
||
|
||
<li> Click <strong>Send</strong>.</li>
|
||
</ol>
|
||
<p>To use geographic data from a GPS exchange format (GPX) or Keyhole Markup
|
||
Language (KML) file:</p>
|
||
<ol>
|
||
<li> Click <strong>Load GPX/KML</strong>.</li>
|
||
<li> In the file dialog, select a file on your computer and click
|
||
<strong>Open</strong>.</li>
|
||
<li> Optionally select a <strong>Speed</strong>.</li>
|
||
<p>The speed defaults to the <strong>Delay</strong> value (<strong>Speed
|
||
1X</strong>). You can increase the speed by double (<strong>Speed</strong>
|
||
<strong>2X</strong>), triple (<strong>Speed 3X</strong>), and so on.</p>
|
||
|
||
<li> Click Run <img src="{@docRoot}images/tools/e-irun.png"
|
||
style="vertical-align:sub;margin:0;height:17px" alt="Run icon" />.</li>
|
||
</ol>
|
||
</td>
|
||
<td><div>Ctrl+Shift+L</div><div>⇧⌘L</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Cellular</td>
|
||
<td><p>The emulator lets you simulate various network conditions. You can
|
||
approximate the network speed for different network protocols, or you can
|
||
specify <strong>Full</strong>, which transfers data as quickly as your
|
||
computer allows. Specifying a network protocol is always slower than
|
||
<strong>Full</strong>. You can also specify the voice and data network
|
||
status, such as roaming. The defaults are set in the AVD.</p>
|
||
<p>Select a <strong>Network type</strong>:</p>
|
||
<ul>
|
||
<li> GSM - Global System for Mobile Communications</li>
|
||
<li> HSCSD - High-Speed Circuit-Switched Data</li>
|
||
<li> GPRS - Generic Packet Radio Service</li>
|
||
<li> EDGE - Enhanced Data rates for GSM Evolution</li>
|
||
<li> UMTS - Universal Mobile Telecommunications System</li>
|
||
<li> HSPDA - High-Speed Downlink Packet Access</li>
|
||
<li> Full (default)</li>
|
||
</ul>
|
||
<p>Select a <strong>Voice status</strong>, <strong>Data status</strong>, or
|
||
both:</p>
|
||
<ul>
|
||
<li> Home (default)</li>
|
||
<li> Roaming</li>
|
||
<li> Searching</li>
|
||
<li> Denied (emergency calls only)</li>
|
||
<li> Unregistered (off)</li>
|
||
</ul>
|
||
</td>
|
||
<td><div>Ctrl+Shift+C</div><div>⇧⌘C</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Battery</td>
|
||
<td><p>You can simulate the battery properties of a device to see how your
|
||
app performs under different conditions. To select a <strong>Charge
|
||
level</strong>, use the slider control.</p>
|
||
<p>Select a <strong>Charger connection</strong> value:</p>
|
||
<ul>
|
||
<li>None</li>
|
||
<li>AC charger</li>
|
||
</ul>
|
||
<p>Select a <strong>Battery health</strong> value:</p>
|
||
<ul>
|
||
<li> Good (default)</li>
|
||
<li> Failed</li>
|
||
<li> Dead</li>
|
||
<li> Overvoltage</li>
|
||
<li> Overheated</li>
|
||
<li> Unknown</li>
|
||
</ul>
|
||
<p>Select a <strong>Battery status </strong>value:</p>
|
||
<ul>
|
||
<li> Unknown</li>
|
||
<li> Charging (default)</li>
|
||
<li> Discharging</li>
|
||
<li> Not charging</li>
|
||
<li> Full</li>
|
||
</ul>
|
||
</td>
|
||
<td><div>Ctrl+Shift+B</div><div>⇧⌘B</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Phone</td>
|
||
<td><p>The emulator lets you simulate incoming phone calls and text
|
||
messages. Note that the information flow is one way, from the control to
|
||
the emulator. For example, the control doesn’t change its state if the
|
||
emulator hangs up; you need to end the call in the control.</p>
|
||
<p>To initiate a call to the emulator:</p>
|
||
<ol>
|
||
<li> Select or type a phone number in the <strong>From</strong> field.</li>
|
||
<li> Click <strong>Call Device</strong>.</li>
|
||
<li> Optionally click <strong>Hold Call</strong> to put the call on hold.</li>
|
||
<li> To end the call, click <strong>End Call</strong>.</li>
|
||
</ol>
|
||
<p>To send a text message to the emulator:</p>
|
||
<ol>
|
||
<li> Select or type a phone number in the <strong>From</strong> field.</li>
|
||
<li> Type a message in the <strong>SMS message</strong> field.</li>
|
||
<li> Click <strong>Send Message</strong>.</li>
|
||
</ol>
|
||
</td>
|
||
<td><div>Ctrl+Shift+P</div><div>⇧⌘P</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Directional Pad</td>
|
||
<td><p>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:</p>
|
||
<img src="{@docRoot}images/tools/e-dpad.png"
|
||
style="vertical-align:sub;margin:0;width:244px" alt="Directional Pad Control" />
|
||
</td>
|
||
<td><div>Ctrl+Shift+D</div><div>⇧⌘D</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Fingerprint</td>
|
||
<td><p>This control can simulate 10 different fingerprint scans. You can
|
||
use it to test fingerprint integration in your app. This feature isn't
|
||
supported for Android Wear.</p>
|
||
<p>To simulate a fingerprint scan on the virtual device:</p>
|
||
<ol>
|
||
<li> Prepare an app to receive a fingerprint.</li>
|
||
<li> Select a <strong>Fingerprint</strong> value.</li>
|
||
<li> Click <strong>Touch Sensor</strong>.</li>
|
||
</ol>
|
||
</td>
|
||
<td><div>Ctrl+Shift+F</div><div>⇧⌘F</div></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Settings</td>
|
||
<td><p>You can specify the following settings:</p>
|
||
<ul>
|
||
<li> <strong>Emulator window theme</strong> - Select Light or Dark.</li>
|
||
<li> <strong>Send keyboard shortcuts to</strong> - By default, some keyboard
|
||
combinations will trigger emulator control shortcuts. If you’re developing
|
||
an app that includes keyboard shortcuts, such as one targeted at
|
||
devices with Bluetooth keyboards, you can change this setting to send
|
||
<em>all</em> keyboard input to the virtual device, including input
|
||
that would be a shortcut in the emulator.</li>
|
||
<li> <strong>Screenshot save location</strong> - Click the folder icon to
|
||
specify a location to save screenshots of the emulator screen.</li>
|
||
<li> <strong>Use detected ADB location</strong> - If you're running the
|
||
emulator from Android Studio, you should select this setting (the default).
|
||
If you run the emulator from outside Android Studio and want it to use a
|
||
specific adb executable, deselect this option and specify the SDK Tools
|
||
location. If this setting is incorrect, features such as drag-and-drop app
|
||
install and file copy, and screenshot capture, won't work. </li>
|
||
<li> <strong>When to send crash reports</strong> - Select Always, Never, or
|
||
Ask. </li>
|
||
</ul>
|
||
</td>
|
||
<td>Ctrl+Shift+S<br>⇧⌘S</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Help > Keyboard Shortcuts</td>
|
||
<td><p>See the keyboard shortcuts that the emulator accepts. For the
|
||
shortcuts to work, you need to:</p>
|
||
<ul>
|
||
<li>Select <strong>Settings</strong> > <strong>Send keyboard shortcuts
|
||
to</strong> > <strong>Emulator controls (default)</strong>.</li>
|
||
</ul>
|
||
</td>
|
||
<td>F1<br>⌘/</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Help > Emulator Help</td>
|
||
<td><p>To go to the online documentation for the emulator, click
|
||
<strong>Documentation</strong>.</p>
|
||
<p>To file a bug against the emulator, click <strong>File a Bug</strong>.
|
||
</p>
|
||
<p>To make suggestions, click <strong>Send Feedback</strong>.</p>
|
||
<p>All of these links require an internet connection and a browser.</p> </td>
|
||
<td>F1<br>⌘/</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Help > About</td>
|
||
<td><p>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.
|
||
</p>
|
||
<p>The emulator serial number is <strong>emulator-<em></strong>adb_port</em>,
|
||
which you can specify as an adb command line option, for example.</p></td>
|
||
<td>F1<br>⌘/</td>
|
||
</tr>
|
||
</table>
|
||
|
||
|
||
|
||
|
||
|