Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 1 | page.title=Running Apps in the Android Emulator |
| 2 | parent.title=Android Studio |
| 3 | parent.link=index.html |
| 4 | page.tags=emulator |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 5 | @jd:body |
| 6 | |
| 7 | <div id="qv-wrapper"> |
| 8 | <div id="qv"> |
| 9 | |
| 10 | <h2>In this document</h2> |
| 11 | <ol> |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 12 | <li><a href="#about">About the Android Emulator</a></li> |
| 13 | <li><a href="#runningapp">Running an App in the Android Emulator</a></li> |
| 14 | <li><a href="#runningemulator">Launching the Android Emulator Without Running an App</a></li> |
| 15 | <li><a href="#navigate">Navigating on the Screen</a></li> |
| 16 | <li><a href="#tasks">Performing Basic Tasks in the Emulator</a></li> |
| 17 | <li><a href="#extended">Working With Extended Controls, Settings, and Help</a></li> |
| 18 | |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 19 | </ol> |
| 20 | |
| 21 | <h2>See also</h2> |
| 22 | <ol> |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 23 | <li><a href="{@docRoot}tools/help/emulator.html">Android Emulator Command Line Features</a></li> |
| 24 | <li><a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with |
| 25 | AVD Manager</a></li> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 26 | </ol> |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 27 | |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 28 | </div> |
| 29 | </div> |
| 30 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 31 | <p>The Android Emulator simulates a device and displays it on your development |
| 32 | computer. It lets you prototype, develop, and test |
| 33 | Android apps without using a hardware device. The emulator supports Android |
| 34 | phone, tablet, Android Wear, and Android TV devices. It comes with predefined |
| 35 | device types |
| 36 | so you can get started quickly, and you can create your own device definitions |
| 37 | and emulator skins.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 38 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 39 | <p>The Android Emulator is fast, |
| 40 | powerful, and feature-rich. It can transfer information faster than using |
| 41 | a connected hardware device, speeding up the development process. The |
| 42 | multi-core feature lets the emulator take advantage of multiple core |
| 43 | processors on your development computer to improve emulator performance even |
| 44 | more.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 45 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 46 | <img src="{@docRoot}images/tools/e-emulator.png" style="height:400px" alt="emulator"/> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 47 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 48 | <h2 id="about">About the Android Emulator</h2> |
| 49 | |
| 50 | <p>You can launch an app on the emulator when you run your project, or you can |
| 51 | drag an APK file onto the emulator to install it. As with a hardware device, |
| 52 | after you install an app |
| 53 | on a virual device, it remains until you uninstall or replace it. If needed, you |
| 54 | can test how multiple apps, such as your own or system apps, work with each |
| 55 | other.</p> |
| 56 | |
| 57 | <h3 id="features">Features for trying out your apps</h3> |
| 58 | |
| 59 | <p>You interact with the emulator just as you would with a hardware device, but |
| 60 | using your mouse and keyboard, and emulator buttons and controls. |
| 61 | The emulator supports virtual hardware buttons and touchscreens, including |
| 62 | two-finger operations, |
| 63 | as well as directional pads (D-pads), trackballs, wheels, and various |
| 64 | sensors. You can dynamically resize the emulator window as needed, zoom in and |
| 65 | out, change the orientation, and even take a screenshot.</p> |
| 66 | |
| 67 | <p>When your app is running on |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 68 | the emulator, it can use the services of the Android platform to invoke other |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 69 | apps, access the network, play audio and video, accept audio input, |
| 70 | store and retrieve data, notify the user, and render graphical transitions and |
| 71 | themes. The emulator has controls that let |
| 72 | you easily send incoming phone calls and text messages, specify |
| 73 | the location of the device, simulate fingerprint scans, specify network |
| 74 | speed and status, and simulate battery properties. The emulator can |
| 75 | simulate an SD card and internal data storage; you can drag a file, such as a |
| 76 | graphics or data file, onto the emulator to store it.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 77 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 78 | <h3 id="avds">Android Virtual Device configurations</h3> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 79 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 80 | <p>The emulator uses an Android Virtual Device (AVD) configuration to determine |
| 81 | the look, functionality, and system image of the simulated device. AVDs let you |
| 82 | define certain hardware aspects of your emulated devices and allow you to create |
| 83 | many configurations to test different Android platforms and hardware |
| 84 | permutations.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 85 | |
| 86 | <p>Each AVD functions as an independent device, with its own private storage for |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 87 | user data, SD card, and so on. When you launch the emulator with an AVD |
| 88 | configuration, it automatically loads the user data and SD card data from the |
| 89 | AVD directory. By default, the emulator stores the user data, SD card data, and |
| 90 | cache in the AVD directory.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 91 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 92 | <p>To create and manage AVDs, use the |
| 93 | <a href="{@docRoot}tools/devices/managing-avds.html">AVD Manager</a>. |
| 94 | For more information, see |
| 95 | <a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 96 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 97 | <h3 id="system">System images</h3> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 98 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 99 | <p>The Android Emulator runs a full |
| 100 | Android system stack, down to the kernel level, that includes a set of |
| 101 | preinstalled apps (such as the dialer) that you can access from your |
| 102 | apps. You can choose which version of the Android system you want to |
| 103 | run in the emulator when creating AVDs. |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 104 | </p> |
| 105 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 106 | <p>The Android system images available through the AVD Manager contain |
| 107 | code for the Android Linux kernel, the native libraries, the VM, and the |
| 108 | various Android packages (such as the Android framework and preinstalled |
| 109 | apps).</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 110 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 111 | <h3 id="dependencies">Dependencies and prerequisites</h3> |
| 112 | <p>The Android Emulator has the following requirements:</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 113 | <ul> |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 114 | <li>Android Studio 2.0 or higher</li> |
| 115 | <li>SDK Tools 25.0.10 or higher</li> |
| 116 | <li><a href="{@docRoot}sdk/index.html#Requirements">System |
| 117 | requirements</a></li> |
| 118 | <li>Newly created AVDs to replace any AVDs for emulator 24.0.<em>x</em> or |
| 119 | lower</li> |
| 120 | <li>Active network connection for certain operations, such as testing app |
| 121 | features that require it</li> |
| 122 | <li>adb integration enabled through <strong>Tools</strong> > |
| 123 | <strong>Android</strong> > <strong>Enable ADB Integration</strong> |
| 124 | </li> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 125 | </ul> |
| 126 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 127 | <h3 id="limitations">What's not supported</h3> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 128 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 129 | <p>The Android Emulator supports most features of a device, but doesn't |
| 130 | include virtual hardware for:</p> |
| 131 | <ul> |
| 132 | <li>WiFi</li> |
| 133 | <li>Bluetooth</li> |
| 134 | <li>NFC</li> |
| 135 | <li>SD card insert/eject</li> |
| 136 | <li>Device-attached headphones</li> |
| 137 | <li>USB</li> |
| 138 | </ul> |
| 139 | <p>The watch emulator for Android Wear doesn't support the Overview |
| 140 | (Recent Apps) button, D-pad, and fingerprint sensor.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 141 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 142 | <p>While most end users of phones and tablets tend to use earlier API levels, |
| 143 | Android Wear and Android TV users tend to use the latest releases. Using recent |
| 144 | releases can give you a better experience using the emulator. |
| 145 | </p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 146 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 147 | <h2 id="runningapp">Running an App in the Android Emulator</h2> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 148 | |
Cheryl Potter | 6c0d591 | 2016-03-24 16:25:53 -0700 | [diff] [blame] | 149 | <p>You can run an app from an Android Studio project. Or, you can run an app |
| 150 | that's been installed on the emulator as you would run any app on a device.</p> |
| 151 | |
| 152 | <p>To start the emulator and run an app in your project:</p> |
| 153 | <ol> |
| 154 | <li>Open an Android Studio project and select Run <img src="{@docRoot}images/tools/e-irun.png" |
| 155 | style="vertical-align:sub;margin:0;height:17px" alt="Run icon" />.</li> |
| 156 | <p>The <em>Select Deployment Target</em> dialog appears.</p> |
| 157 | <img src="{@docRoot}images/tools/e-selectdeploymenttarget.png" |
| 158 | style="height:250px" alt="Select Deployment Target dialog" /> |
| 159 | <li>If you receive an error or warning message at the top of the dialog, click |
| 160 | the link to correct the problem or get more information.</li> |
| 161 | <p>The <strong>No USB devices or running emulators detected</strong> warning |
| 162 | means that you don’t currently have any emulators running, or any detected |
| 163 | hardware devices connected to your computer. If you |
| 164 | don’t have hardware devices connected to your computer, or any emulators |
| 165 | running, you can ignore it. </p> |
| 166 | <p>Some errors you must fix before you can continue, such as certain Hardware |
| 167 | Accelerated Execution Manager (Intel® HAXM) errors.</p> |
| 168 | <li>In the <em>Select Deployment Target</em> dialog, select an existing emulator |
| 169 | definition, and then click <strong>OK</strong>.</p> |
| 170 | <p>If you don’t see a definition you want to use, click <strong>Create New |
| 171 | Emulator</strong> to launch the AVD Manager. After you define a new AVD, in |
| 172 | the <em>Select Deployment |
| 173 | Target</em> dialog, click <strong>OK</strong>.</p> |
| 174 | <p>If you want to use this emulator definition as the default for your project, |
| 175 | select <strong>Use same selection for future launches</strong>.</p> |
| 176 | <p>The emulator launches and displays your app.</p> |
| 177 | <li>Test your app in the emulator.</li> |
| 178 | <p>You can use the features described in the following sections:</p> |
| 179 | <ul> |
| 180 | <li><a href="#navigate">Navigating on the Screen</a></li> |
| 181 | <li><a href="#tasks">Performing Basic Tasks in the Emulator</a></li> |
| 182 | <li><a href="#extended">Working With Extended Controls, Settings, and Help</a></li> |
| 183 | </ul> |
| 184 | <li>To close the emulator, click Close <img src="{@docRoot}images/tools/e-iclose.png" |
| 185 | style="vertical-align:sub;margin:0;height:17px" alt="Close icon" />.</li> |
| 186 | <p>The emulator device stores the installed app so you can run it again, if |
| 187 | needed. You need to uninstall an app to remove it. If you run the project |
| 188 | again on the same emulator, it replaces the app with the new version.</p> |
| 189 | </ol> |
| 190 | |
| 191 | <h2 id="runningemulator">Launching the Android Emulator Without Running an App</h2> |
| 192 | |
| 193 | <p>To start the emulator:</p> |
| 194 | <ol> |
| 195 | <li><a href="{@docRoot}tools/devices/managing-avds.html">Open the AVD Manager</a>.</li> |
| 196 | <li>Double-click an AVD, or click Run <img src="{@docRoot}images/tools/e-irun.png" |
| 197 | style="vertical-align:sub;margin:0;height:17px" alt="Run icon" />.</li> |
| 198 | <p>The Android Emulator appears.</p> |
| 199 | <p>While the emulator is running, you can run Android Studio projects and |
| 200 | choose the |
| 201 | emulator as the target device. You can also drag one or more APKs onto the |
| 202 | emulator to install them, and then run them.</p> |
| 203 | </ol> |
| 204 | |
| 205 | |
| 206 | <h2 id="navigate">Navigating on the Screen</h2> |
| 207 | |
| 208 | <p>Use your computer mouse pointer to mimic your finger on the touchscreen; |
| 209 | select menu items and input fields; and click buttons and controls. |
| 210 | Use your computer keyboard to type characters and enter emulator shortcuts.</p> |
| 211 | <table border="0" style="clear:left;"> |
| 212 | <tr> |
| 213 | <th scope="col">Feature</th> |
| 214 | <th scope="col">Description</th> |
| 215 | </tr> |
| 216 | |
| 217 | <tr> |
| 218 | <td>Swipe the screen</td> |
| 219 | <td>Point to the screen, press and hold the primary mouse button, swipe |
| 220 | across the screen, and then release.</td> |
| 221 | </tr> |
| 222 | <tr> |
| 223 | <td>Drag an item</td> |
| 224 | <td>Point to an item on the screen, press and hold the primary mouse |
| 225 | button, move the item, and then release.</td> |
| 226 | </tr> |
| 227 | <tr> |
| 228 | <td>Tap <div>(touch)</div></td> |
| 229 | <td>Point to the screen, press the primary mouse button, and then release. |
| 230 | For example, you could click a text field to start typing in it, select an |
| 231 | app, or press a button.</td> |
| 232 | </tr> |
| 233 | <tr> |
| 234 | <td>Double tap</td> |
| 235 | <td>Point to the screen, press the primary mouse button quickly twice, |
| 236 | and then release.</td> |
| 237 | </tr> |
| 238 | <tr> |
| 239 | <td>Touch and hold</td> |
| 240 | <td>Point to an item on the screen, press the primary mouse button, hold, |
| 241 | and then release. For example, you could open options for an item. </td> |
| 242 | </tr> |
| 243 | <tr> |
| 244 | <td>Type</td> |
| 245 | <td>You can type in the emulator by using your computer keyboard, or using |
| 246 | a keyboard that pops up on the emulator screen. For example, you could |
| 247 | type in a text field after you selected it.</td> |
| 248 | </tr> |
| 249 | <tr> |
| 250 | <td><nobr>Pinch and spread</nobr></td> |
| 251 | <td><div>Pressing Alt or Option (⌥) brings up a pinch gesture multi-touch |
| 252 | interface. The mouse acts as the first finger, and across the anchor point |
| 253 | is the second finger. Drag the cursor to move the first point.</div> |
| 254 | <div>Clicking the left mouse button acts like touching down both points, and |
| 255 | releasing acts like picking both up.</div></td> |
| 256 | </tr> |
| 257 | </table> |
| 258 | |
| 259 | <h2 id="tasks">Performing Basic Tasks in the Emulator</h2> |
| 260 | |
| 261 | <p>The panel on the right side of the emulator lets you perform various tasks. |
| 262 | You can also drag files onto the emulator to install apps and download files. |
| 263 | </p> |
| 264 | <table border="0" style="clear:left;"> |
| 265 | <tr> |
| 266 | <th scope="col">Feature</th> |
| 267 | <th scope="col">Description</th> |
| 268 | <th scope="col">Keyboard Shortcut</th> |
| 269 | </tr> |
| 270 | <tr> |
| 271 | <td>Close<br><img src="{@docRoot}images/tools/e-iclose.png" |
| 272 | style="vertical-align:sub;margin:0;height:17px" alt="Close icon" /></td> |
| 273 | <td>Close the emulator.</td> |
| 274 | <td></td> |
| 275 | </tr> |
| 276 | <tr> |
| 277 | <td>Minimize<br><img src="{@docRoot}images/tools/e-iminimize.png" |
| 278 | style="vertical-align:sub;margin:0;height:9px" alt="Minimize icon" /></td> |
| 279 | <td>Minimize the emulator window.</td> |
| 280 | <td></td> |
| 281 | </tr> |
| 282 | <tr> |
| 283 | <td>Resize</td> |
| 284 | <td>Resize the emulator as you would any other operating system window. The |
| 285 | emulator maintains an aspect ratio appropriate for your device.</td> |
| 286 | <td>⌘↑ and ⌘↓</td> |
| 287 | </tr> |
| 288 | <tr> |
| 289 | <td>Power<br><img src="{@docRoot}images/tools/e-ipower.png" |
| 290 | style="vertical-align:sub;margin:0;height:17px" alt="Power icon" /></td> |
| 291 | <td>Click to turn the screen on or off.<br>Click and hold to turn the device |
| 292 | on or off. </td> |
| 293 | <td><div>Ctrl+P</div> <div>⌘P</div></td> |
| 294 | </tr> |
| 295 | <tr> |
| 296 | <td>Volume Up<br><img src="{@docRoot}images/tools/e-ivolumeup.png" |
| 297 | style="vertical-align:sub;margin:0;height:17px" alt="Volume Up icon" /></td> |
| 298 | <td>Click to view a slider control and turn the volume up. Click again to |
| 299 | turn it up more, or use the slider control to change the volume. </td> |
| 300 | <td><div>Ctrl+=</div><div>⌘=</div></td> |
| 301 | </tr> |
| 302 | <tr> |
| 303 | <td>Volume Down<br><img src="{@docRoot}images/tools/e-ivolumedown.png" |
| 304 | style="vertical-align:sub;margin:0;height:17px" alt="Volume Down icon" /></td> |
| 305 | <td>Click to view a slider control and turn the volume down. Click again to |
| 306 | turn it down more, or use the slider control to change the volume. </td> |
| 307 | <td><div>Ctrl+-</div><div>⌘-<div></td> |
| 308 | </tr> |
| 309 | <tr> |
| 310 | <td>Rotate Left<br><img src="{@docRoot}images/tools/e-irotateleft.png" |
| 311 | style="vertical-align:sub;margin:0;height:17px" alt="Rotate Left icon" /></td> |
| 312 | <td>Rotate the phone 90 degrees counterclockwise.</td> |
| 313 | <td><div>Ctrl+Left</div><div>⌘←</div></td> |
| 314 | </tr> |
| 315 | <tr> |
| 316 | <td>Rotate Right<br><img src="{@docRoot}images/tools/e-irotateright.png" |
| 317 | style="vertical-align:sub;margin:0;height:17px" alt="Rotate Right icon" /></td> |
| 318 | <td>Rotate the phone 90 degrees clockwise.</td> |
| 319 | <td><div>Ctrl+Right</div><div>⌘→</div></td> |
| 320 | </tr> |
| 321 | <tr> |
| 322 | <td>Take Screenshot<br><img src="{@docRoot}images/tools/e-itakescreenshot.png" |
| 323 | style="vertical-align:sub;margin:0;height:17px" alt="Take Screenshot icon" /> |
| 324 | </td> |
| 325 | <td>Click to take a screenshot of the device. The default save location is |
| 326 | your computer desktop. To change the save location, select |
| 327 | <strong>…</strong> > <strong>Settings</strong>. The emulator creates a |
| 328 | file with the name <code>Screenshot_<em>yyyymmdd-hhmmss</em>.png</code> |
| 329 | using the year, month, day, hour, minute, and second of the capture, for |
| 330 | example, <code>Screenshot_20160219-145848.png</code>. </td> |
| 331 | <td><div>Ctrl+S</div><div>⌘S<div></td> |
| 332 | </tr> |
| 333 | <tr> |
| 334 | <td><nobr>Enter Zoom Mode</nobr><br><img src="{@docRoot}images/tools/e-izoom.png" |
| 335 | style="vertical-align:sub;margin:0;height:17px" alt="Enter Zoom Mode icon" /> |
| 336 | </td> |
| 337 | <td><p>Click so the cursor changes to the zoom icon:</p> |
| 338 | <ul> |
| 339 | <li> Left-click the screen to zoom in by 25%, up to a maximum of about twice |
| 340 | the screen resolution of the virtual device. |
| 341 | <li> Right-click to zoom out. |
| 342 | <li> Left-click and drag to select a box-shaped area to zoom in on. |
| 343 | <li> Right-click and drag a selection box to reset to default zoom. |
| 344 | <li> Ctrl-click to touch the screen while in zoom mode. |
| 345 | </ul> |
| 346 | <p>Click Enter Zoom Mode again to return to normal screen size.</p></td> |
| 347 | <td><div>Ctrl+Z</div><div>⌘Z</div> |
| 348 | <div>While in zoom mode:</div> |
| 349 | <div>Ctrl+Up</div><div>Ctrl+Down</div> |
| 350 | <div>Ctrl+Shift+Up</div><div>Ctrl+Shift+Down</div> |
| 351 | <div>Ctrl+Shift+Left</div><div>Ctrl+Shift+Right</div> |
| 352 | <div>⌘↑ and ⌘↓</div> |
| 353 | <div>⇧⌘↑ and ⇧⌘↓</div> |
| 354 | <div>⇧⌘← and ⇧⌘→</div></td> |
| 355 | </tr> |
| 356 | <tr> |
| 357 | <td>Back<br><img src="{@docRoot}images/tools/e-iback.png" |
| 358 | style="vertical-align:sub;margin:0;height:17px" alt="Back icon" /></td> |
| 359 | <td>Return to the previous screen, or close a dialog box, an options menu, |
| 360 | the Notifications panel, or the onscreen keyboard. </td> |
| 361 | <td><div>Ctrl+Backspace</div> |
| 362 | <div>⌘⌫</div></td> |
| 363 | </tr> |
| 364 | <tr> |
| 365 | <td>Home<br><img src="{@docRoot}images/tools/e-ihome.png" |
| 366 | style="vertical-align:sub;margin:0;height:17px" alt="Home icon" /></td> |
| 367 | <td>Return to the Home screen. Press and hold to open the item specific to |
| 368 | your API level. </td> |
| 369 | <td><div>Ctrl+H</div><div>⌘⇧H</div></td> |
| 370 | </tr> |
| 371 | <tr> |
| 372 | <td><div>Overview<br><img src="{@docRoot}images/tools/e-ioverview.png" |
| 373 | style="vertical-align:sub;margin:0;height:17px" alt="Overview icon" /></div> |
| 374 | <div>(Recent Apps)</div></td> |
| 375 | <td>Tap to open a list of thumbnail images of apps you’ve worked with |
| 376 | recently. To open an app, tap it. To remove a thumbnail from the list, |
| 377 | swipe it left or right. This button isn't supported for Android Wear.</td> |
| 378 | <td><div>Ctrl+O</div><div>⌘O</div></td> |
| 379 | </tr> |
| 380 | <tr> |
| 381 | <td>Menu</td> |
| 382 | <td>Type the keyboard shortcut to simulate the Menu button, for example, |
| 383 | to open the menu for the selected app.</td> |
| 384 | <td><div>Ctrl+M</div><div>⌘M</div></td> |
| 385 | </tr> |
| 386 | <tr> |
| 387 | <td>More<br><img src="{@docRoot}images/tools/e-imore.png" |
| 388 | style="vertical-align:sub;margin:0;height:9px" alt="More icon" /></td> |
| 389 | <td>Click to access other features and settings, described in the next |
| 390 | table.</td> |
| 391 | <td></td> |
| 392 | </tr> |
| 393 | <tr> |
| 394 | <td>Install an APK</td> |
| 395 | <td>Drag an APK file onto the emulator screen. An APK Installer dialog |
| 396 | appears. When the installation completes, you can view the app in your |
| 397 | apps list.The app didn’t install if a dialog appears that says “APK failed |
| 398 | to install.”</td> |
| 399 | <td></td> |
| 400 | </tr> |
| 401 | <tr> |
| 402 | <td>Add a file</td> |
| 403 | <td>Drag any file onto the emulator screen. It’s placed in the |
| 404 | <code>/sdcard/Download</code> directory. Navigate to the file using the |
| 405 | method for the API level. For example, for API 22, this is the navigation |
| 406 | path: <strong>Settings</strong> > <strong>Device: Storage & USB</strong> |
| 407 | > <strong>Internal Storage</strong> > <strong>Explore</strong> |
| 408 | (Virtual SD Card). </td> |
| 409 | <td></td> |
| 410 | </tr> |
| 411 | <tr> |
| 412 | <td>Toggle trackball mode</td> |
| 413 | <td></td> |
| 414 | <td>F6</td> |
| 415 | </tr> |
| 416 | </table> |
| 417 | |
| 418 | <h2 id="extended">Working With the Extended Controls, Settings, and Help</h2> |
| 419 | |
| 420 | <p>The extended controls let you send data, change device properties, control |
| 421 | apps, and more. To access the controls, select <strong>…</strong> in the |
| 422 | emulator panel and then select the option you want in the left panel of the |
| 423 | <em>Extended Controls</em> dialog.</p> |
| 424 | |
| 425 | <table border="0" style="clear:left;"> |
| 426 | <tr> |
| 427 | <th scope="col">Feature</th> |
| 428 | <th scope="col">Description</th> |
| 429 | <th scope="col">Keyboard Shortcuts</th> |
| 430 | </tr> |
| 431 | <tr> |
| 432 | <td>Location</td> |
| 433 | <td> |
| 434 | <p>The emulator lets you simulate “my location” information: the location where |
| 435 | the emulated device is currently located. For example, if you click My Location |
| 436 | <img src="{@docRoot}images/tools/e-ilocation.png" |
| 437 | style="vertical-align:sub;margin:0;height:17px" alt="My Location icon" /> |
| 438 | in Google Maps and then send a location, the map shows it.</p> |
| 439 | <p>To send a GPS location:</p> |
| 440 | <ol> |
| 441 | <li> Select <strong>Decimal</strong> or <strong>Sexagesimal</strong>.</li> |
| 442 | <li> Specify the location.</li> |
| 443 | |
| 444 | <p>In decimal mode, enter a <strong>Latitude</strong> value in the range -90.0 |
| 445 | to +90.0 degrees and a <strong>Longitude</strong> value in the range -180.0 to |
| 446 | +180.0 degrees.</p> |
| 447 | <p>In sexigesimal mode, enter a three-part <strong>Latitude</strong> value in |
| 448 | the range -90 to +90 degrees, 0 to 59 minutes, and 0.0 to 60.0 |
| 449 | seconds. Enter a <strong>Longitude</strong> value in the range -180 to +180 |
| 450 | degrees, 0 to 59 minutes, and 0.0 to 60.0 seconds.</p> |
| 451 | <p>For the latitude, - indicates south and + indicates north; for the longitude, |
| 452 | - indicates west and + indicates east. The + is optional.</p> |
| 453 | <p>Optionally specify an <strong>Altitude</strong> value in the range |
| 454 | -1,000.0 to +10,000.0 meters.</p> |
| 455 | |
| 456 | <li> Click <strong>Send</strong>.</li> |
| 457 | </ol> |
| 458 | <p>To use geographic data from a GPS exchange format (GPX) or Keyhole Markup |
| 459 | Language (KML) file:</p> |
| 460 | <ol> |
| 461 | <li> Click <strong>Load GPX/KML</strong>.</li> |
| 462 | <li> In the file dialog, select a file on your computer and click |
| 463 | <strong>Open</strong>.</li> |
| 464 | <li> Optionally select a <strong>Speed</strong>.</li> |
| 465 | <p>The speed defaults to the <strong>Delay</strong> value (<strong>Speed |
| 466 | 1X</strong>). You can increase the speed by double (<strong>Speed</strong> |
| 467 | <strong>2X</strong>), triple (<strong>Speed 3X</strong>), and so on.</p> |
| 468 | |
| 469 | <li> Click Run <img src="{@docRoot}images/tools/e-irun.png" |
| 470 | style="vertical-align:sub;margin:0;height:17px" alt="Run icon" />.</li> |
| 471 | </ol> |
| 472 | </td> |
| 473 | <td><div>Ctrl+Shift+L</div><div>⇧⌘L</div></td> |
| 474 | </tr> |
| 475 | <tr> |
| 476 | <td>Cellular</td> |
| 477 | <td><p>The emulator lets you simulate various network conditions. You can |
| 478 | approximate the network speed for different network protocols, or you can |
| 479 | specify <strong>Full</strong>, which transfers data as quickly as your |
| 480 | computer allows. Specifying a network protocol is always slower than |
| 481 | <strong>Full</strong>. You can also specify the voice and data network |
| 482 | status, such as roaming. The defaults are set in the AVD.</p> |
| 483 | <p>Select a <strong>Network type</strong>:</p> |
| 484 | <ul> |
| 485 | <li> GSM - Global System for Mobile Communications</li> |
| 486 | <li> HSCSD - High-Speed Circuit-Switched Data</li> |
| 487 | <li> GPRS - Generic Packet Radio Service</li> |
| 488 | <li> EDGE - Enhanced Data rates for GSM Evolution</li> |
| 489 | <li> UMTS - Universal Mobile Telecommunications System</li> |
| 490 | <li> HSPDA - High-Speed Downlink Packet Access</li> |
| 491 | <li> Full (default)</li> |
| 492 | </ul> |
| 493 | <p>Select a <strong>Voice status</strong>, <strong>Data status</strong>, or |
| 494 | both:</p> |
| 495 | <ul> |
| 496 | <li> Home (default)</li> |
| 497 | <li> Roaming</li> |
| 498 | <li> Searching</li> |
| 499 | <li> Denied (emergency calls only)</li> |
| 500 | <li> Unregistered (off)</li> |
| 501 | </ul> |
| 502 | </td> |
| 503 | <td><div>Ctrl+Shift+C</div><div>⇧⌘C</td> |
| 504 | </tr> |
| 505 | <tr> |
| 506 | <td>Battery</td> |
| 507 | <td><p>You can simulate the battery properties of a device to see how your |
| 508 | app performs under different conditions. To select a <strong>Charge |
| 509 | level</strong>, use the slider control.</p> |
| 510 | <p>Select a <strong>Charger connection</strong> value:</p> |
| 511 | <ul> |
| 512 | <li>None</li> |
| 513 | <li>AC charger</li> |
| 514 | </ul> |
| 515 | <p>Select a <strong>Battery health</strong> value:</p> |
| 516 | <ul> |
| 517 | <li> Good (default)</li> |
| 518 | <li> Failed</li> |
| 519 | <li> Dead</li> |
| 520 | <li> Overvoltage</li> |
| 521 | <li> Overheated</li> |
| 522 | <li> Unknown</li> |
| 523 | </ul> |
| 524 | <p>Select a <strong>Battery status </strong>value:</p> |
| 525 | <ul> |
| 526 | <li> Unknown</li> |
| 527 | <li> Charging (default)</li> |
| 528 | <li> Discharging</li> |
| 529 | <li> Not charging</li> |
| 530 | <li> Full</li> |
| 531 | </ul> |
| 532 | </td> |
| 533 | <td><div>Ctrl+Shift+B</div><div>⇧⌘B</div></td> |
| 534 | </tr> |
| 535 | <tr> |
| 536 | <td>Phone</td> |
| 537 | <td><p>The emulator lets you simulate incoming phone calls and text |
| 538 | messages. Note that the information flow is one way, from the control to |
| 539 | the emulator. For example, the control doesn’t change its state if the |
| 540 | emulator hangs up; you need to end the call in the control.</p> |
| 541 | <p>To initiate a call to the emulator:</p> |
| 542 | <ol> |
| 543 | <li> Select or type a phone number in the <strong>From</strong> field.</li> |
| 544 | <li> Click <strong>Call Device</strong>.</li> |
| 545 | <li> Optionally click <strong>Hold Call</strong> to put the call on hold.</li> |
| 546 | <li> To end the call, click <strong>End Call</strong>.</li> |
| 547 | </ol> |
| 548 | <p>To send a text message to the emulator:</p> |
| 549 | <ol> |
| 550 | <li> Select or type a phone number in the <strong>From</strong> field.</li> |
| 551 | <li> Type a message in the <strong>SMS message</strong> field.</li> |
| 552 | <li> Click <strong>Send Message</strong>.</li> |
| 553 | </ol> |
| 554 | </td> |
| 555 | <td><div>Ctrl+Shift+P</div><div>⇧⌘P</div></td> |
| 556 | </tr> |
| 557 | <tr> |
| 558 | <td>Directional Pad</td> |
| 559 | <td><p>If the AVD has the directional pad enabled in the hardware profile, |
| 560 | you can use the directional pad controls with the emulator. However, not |
| 561 | all devices can support the directional pad; for example, an Android watch. |
| 562 | The buttons simulate the following actions:</p> |
| 563 | <img src="{@docRoot}images/tools/e-dpad.png" |
| 564 | style="vertical-align:sub;margin:0;width:244px" alt="Directional Pad Control" /> |
| 565 | </td> |
| 566 | <td><div>Ctrl+Shift+D</div><div>⇧⌘D</div></td> |
| 567 | </tr> |
| 568 | <tr> |
| 569 | <td>Fingerprint</td> |
| 570 | <td><p>This control can simulate 10 different fingerprint scans. You can |
| 571 | use it to test fingerprint integration in your app. This feature isn't |
| 572 | supported for Android Wear.</p> |
| 573 | <p>To simulate a fingerprint scan on the virtual device:</p> |
| 574 | <ol> |
| 575 | <li> Prepare an app to receive a fingerprint.</li> |
| 576 | <li> Select a <strong>Fingerprint</strong> value.</li> |
| 577 | <li> Click <strong>Touch Sensor</strong>.</li> |
| 578 | </ol> |
| 579 | </td> |
| 580 | <td><div>Ctrl+Shift+F</div><div>⇧⌘F</div></td> |
| 581 | </tr> |
| 582 | <tr> |
| 583 | <td>Settings</td> |
| 584 | <td><p>You can specify the following settings:</p> |
| 585 | <ul> |
| 586 | <li> <strong>Emulator window theme</strong> - Select Light or Dark.</li> |
| 587 | <li> <strong>Send keyboard shortcuts to</strong> - By default, some keyboard |
| 588 | combinations will trigger emulator control shortcuts. If you’re developing |
| 589 | an app that includes keyboard shortcuts, such as one targeted at |
| 590 | devices with Bluetooth keyboards, you can change this setting to send |
| 591 | <em>all</em> keyboard input to the virtual device, including input |
| 592 | that would be a shortcut in the emulator.</li> |
| 593 | <li> <strong>Screenshot save location</strong> - Click the folder icon to |
| 594 | specify a location to save screenshots of the emulator screen.</li> |
| 595 | <li> <strong>Use detected ADB location</strong> - If you're running the |
| 596 | emulator from Android Studio, you should select this setting (the default). |
| 597 | If you run the emulator from outside Android Studio and want it to use a |
| 598 | specific adb executable, deselect this option and specify the SDK Tools |
| 599 | location. If this setting is incorrect, features such as drag-and-drop app |
| 600 | install and file copy, and screenshot capture, won't work. </li> |
| 601 | <li> <strong>When to send crash reports</strong> - Select Always, Never, or |
| 602 | Ask. </li> |
| 603 | </ul> |
| 604 | </td> |
| 605 | <td>Ctrl+Shift+S<br>⇧⌘S</td> |
| 606 | </tr> |
| 607 | <tr> |
| 608 | <td>Help > Keyboard Shortcuts</td> |
| 609 | <td><p>See the keyboard shortcuts that the emulator accepts. For the |
| 610 | shortcuts to work, you need to:</p> |
| 611 | <ul> |
| 612 | <li>Select <strong>Settings</strong> > <strong>Send keyboard shortcuts |
| 613 | to</strong> > <strong>Emulator controls (default)</strong>.</li> |
| 614 | </ul> |
| 615 | </td> |
| 616 | <td>F1<br>⌘/</td> |
| 617 | </tr> |
| 618 | <tr> |
| 619 | <td>Help > Emulator Help</td> |
| 620 | <td><p>To go to the online documentation for the emulator, click |
| 621 | <strong>Documentation</strong>.</p> |
| 622 | <p>To file a bug against the emulator, click <strong>File a Bug</strong>. |
| 623 | </p> |
| 624 | <p>To make suggestions, click <strong>Send Feedback</strong>.</p> |
| 625 | <p>All of these links require an internet connection and a browser.</p> </td> |
| 626 | <td>F1<br>⌘/</td> |
| 627 | </tr> |
| 628 | <tr> |
| 629 | <td>Help > About</td> |
| 630 | <td><p>See which adb port the emulator uses, as well as the Android and |
| 631 | emulator version numbers. Compare the latest available emulator version |
| 632 | with your version to determine if you have the latest software installed. |
| 633 | </p> |
| 634 | <p>The emulator serial number is <strong>emulator-<em></strong>adb_port</em>, |
| 635 | which you can specify as an adb command line option, for example.</p></td> |
| 636 | <td>F1<br>⌘/</td> |
| 637 | </tr> |
| 638 | </table> |
| 639 | |
| 640 | |
| 641 | |
| 642 | |
| 643 | |