summaryrefslogtreecommitdiffstats
path: root/docs/html/tools/devices/managing-avds.jd
blob: 9afa88a803917097167cbc85307c55a15b8753b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
page.title=Managing AVDs with AVD Manager
parent.title=Managing Virtual Devices
parent.link=index.html
@jd:body

  <div id="qv-wrapper">
    <div id="qv">
      <h2>In this document</h2>

      <ol>
        <li><a href="#createavd">Creating an AVD</a>
          <ol>
            <li><a href="#hardwareopts">Hardware options</a></li>
          </ol>
        </li>
      </ol>
    </div>
  </div>

  <p>The AVD Manager is an easy to use user interface to manage your AVD (Android Virtual Device)
  configurations. An AVD is a device configuration for the Android emulator that allows you to
  model different configurations of Android-powered devices. When you start the AVD Manager in Android
  Studio or navigate to your SDK's {@code tools/} directory and execute
  <code>android avd</code>, you will see the AVD Manager main screen with your current virtual
  devices. You can right-click an existing AVD to perform actions on the AVD, such as delete,
  duplicate, wipe data, show on disk, and display details. </p>

   <img src="{@docRoot}images/studio-avdmgr-firstscreen.png" alt="">
   <p class="img-caption"><strong>Figure 1.</strong> AVD Manager.</p>


  <h2 id="createavd">Creating an AVD</h2>

  <p>You can create as many AVDs as you would like to test on. It is recommended that you test your
  applications on all API levels higher than the target API level for your application.</p>

  <p>To create an AVD:</p>

  <ol>
    <li>Start the AVD Manager:

      <ul>
        <li>In Android Studio: select <strong>Tools &gt; Android &gt; AVD Manager</strong>, or click
        the AVD Manager icon <img src="{@docRoot}images/ui/studio-avdmgr-icon.png"style="vertical-align:bottom;margin:0;height:19px"> in the Android Studio toolbar.</li>


        <li>In other IDEs: Navigate to your SDK's <code>tools/</code> directory and execute the
        <code>android</code> tool with no arguments.</li>
      </ul>
    </li>

    <li><p>Click <strong>Create Virtual Device</strong> to create an AVD. The
    <strong>Select Hardware</strong> dialog appears.</p>

      <img src="{@docRoot}images/studio-avdmgr-selecthdwr.png">
      <p class="img-caption"><strong>Figure 2.</strong> Select Hardware window.</p>
    </li>

    <li><p>Select the device category and form factor. Click <strong>Edit Device</strong> to modify
    an existing AVD, or click <strong>New Hardware Profile</strong> to create a new hardware profile.
    Click <strong>Next</strong> to continue. </p>
    <p>The hardware profile includes settings for screen size, camera, memory options,input type,
    and sensors. For a list of hardware features, see <a href="#hardwareopts">Hardware options</a>.</p>

      <img src="{@docRoot}images/studio-avdmgr-confighardwareprof.png" alt="">
      <p class="img-caption"><strong>Figure 3.</strong> Configure Hardware window.</p>
    </li>

    <li>Select the desired system image.  Click <strong>Install Latest Version</strong> to download
    a new system image. Click <strong>Next</strong> to continue.
    </li>

    <li>Fill in the details for the AVD.

      <p>Give it a name, device type, platform target, image size, orientation, and emulator
      performance. Click <strong>Show Advanced Settings</strong> to assign a custom skin to the
      hardware profile and other advanced settings for the device type.
      </p>

      <p class="note"><strong>Tip:</strong>Store custom skins in an easily accessible directory,
      such as <em>~/skins</em>. From information about custom skins, see
      <a href="#skins">Skins</a>. </p>

      <img src="{@docRoot}images/studio-avdmgr-configavd.png" alt="">
      <p class="img-caption"><strong>Figure 4.</strong> Configure AVD window.</p>

      <p class="note"><strong>Tip:</strong> Be sure to define a target for your AVD that satisfies
      your application's Build Target (the AVD platform target must have an API Level equal to or
      greater than the API Level that your application compiles against).</p>
    </li>

    <li>Click <strong>Finish</strong>.</li>
  </ol>

  <p>Your AVD is now ready and you can either close the AVD Manager, create more AVDs, or
  manage an emulator with the AVD by clicking an icon in the <strong>Actions</strong> column:
  </p>

  <ul>
    <li>Start an AVD <img src="{@docRoot}images/tools/studio-avdmgr-action-icon.png" alt=""></li>
    <li>Edit an AVD <img src="{@docRoot}images/tools/studio-avdmgr-actions-edit-icon.png" alt=""></li>
    <li>Perform management actions <img src="{@docRoot}images/tools/studio-avdmgr-actions-dropdown-icon.png" alt=""></li>
  </ul>


<h3 id="hardwareopts">Hardware options</h3>
<p>If you are creating a new AVD, you can specify the following hardware options for the AVD
to emulate:</p>

  <table>
    <tr>
      <th>Characteristic</th>

      <th>Description</th>

      <th>Property</th>
    </tr>

    <tr>
      <td>Device ram size</td>

      <td>The amount of physical RAM on the device, in megabytes. Default value is "96".</td>

      <td>hw.ramSize</td>
    </tr>

    <tr>
      <td>Touch-screen support</td>

      <td>Whether there is a touch screen or not on the device. Default value is "yes".</td>

      <td>hw.touchScreen</td>
    </tr>

    <tr>
      <td>Trackball support</td>

      <td>Whether there is a trackball on the device. Default value is "yes".</td>

      <td>hw.trackBall</td>
    </tr>

    <tr>
      <td>Keyboard support</td>

      <td>Whether the device has a QWERTY keyboard. Default value is "yes".</td>

      <td>hw.keyboard</td>
    </tr>

    <tr>
      <td>DPad support</td>

      <td>Whether the device has DPad keys. Default value is "yes".</td>

      <td>hw.dPad</td>
    </tr>

    <tr>
      <td>GSM modem support</td>

      <td>Whether there is a GSM modem in the device. Default value is "yes".</td>

      <td>hw.gsmModem</td>
    </tr>

    <tr>
      <td>Camera support</td>

      <td>Whether the device has a camera. Default value is "no".</td>

      <td>hw.camera</td>
    </tr>

    <tr>
      <td>Maximum horizontal camera pixels</td>

      <td>Default value is "640".</td>

      <td>hw.camera.maxHorizontalPixels</td>
    </tr>

    <tr>
      <td>Maximum vertical camera pixels</td>

      <td>Default value is "480".</td>

      <td>hw.camera.maxVerticalPixels</td>
    </tr>

    <tr>
      <td>GPS support</td>

      <td>Whether there is a GPS in the device. Default value is "yes".</td>

      <td>hw.gps</td>
    </tr>

    <tr>
      <td>Battery support</td>

      <td>Whether the device can run on a battery. Default value is "yes".</td>

      <td>hw.battery</td>
    </tr>

    <tr>
      <td>Accelerometer</td>

      <td>Whether there is an accelerometer in the device. Default value is "yes".</td>

      <td>hw.accelerometer</td>
    </tr>

    <tr>
      <td>Audio recording support</td>

      <td>Whether the device can record audio. Default value is "yes".</td>

      <td>hw.audioInput</td>
    </tr>

    <tr>
      <td>Audio playback support</td>

      <td>Whether the device can play audio. Default value is "yes".</td>

      <td>hw.audioOutput</td>
    </tr>

    <tr>
      <td>SD Card support</td>

      <td>Whether the device supports insertion/removal of virtual SD Cards. Default value is
      "yes".</td>

      <td>hw.sdCard</td>
    </tr>

    <tr>
      <td>Cache partition support</td>

      <td>Whether we use a /cache partition on the device. Default value is "yes".</td>

      <td>disk.cachePartition</td>
    </tr>

    <tr>
      <td>Cache partition size</td>

      <td>Default value is "66MB".</td>

      <td>disk.cachePartition.size</td>
    </tr>

    <tr>
      <td>Abstracted LCD density</td>

      <td>Sets the generalized density characteristic used by the AVD's screen. Default value is
      "160".</td>

      <td>hw.lcd.density</td>
    </tr>
  </table>


<h3 id="skins">Using Custom Emulator Skins</h3>
<p>A custom Android emulator skin is a collection of files that enable you to customize the visual
and control elements of an emulator display. Custom emulator skins enable you to define variations
of emulation properties, such as the use of a trackball or touchscreen, to match your device
customizations. Each custom emulator skin contains:</p>
   <ul>
      <li>A <code>hardware.ini file</code> for initialization settings</li>
      <li>Layout files for supported orientations (landscape, portrait) and physical configuration</li>
      <li>Image files for display elements, such as background, keys and buttons</li>
    </ul>
<p>To create and use a custom skin:</p>
   <ol>
      <li>Create a skin folder in an easily accessible location, such as  <em>~/skins</em>. </li>
      <li>Define the skin orientation and configuration settings in a file called <code>layout</code>
      in the skin folder.
<pre>
parts {

    device {
        display {
            width   1080
            height  1920
            x       0
            y       0
        }
    }

    portrait {
        background {
            image background_port.png
        }

        buttons {
            power {
                image  button_vertical.png
                 x  1229
                 y  616
            }
        }
    }
  ...
}

</pre></li>

      <li>Creates a <code>hardware.ini</code> file for the skin-specific properties that determine
      emulator specifications and behavior. For a complete list of emulator properties, see
      <a href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the Command
      Line</a>. For example:</li>
<pre>
# skin-specific hardware values
hw.lcd.density=213
vm.heapSize=48
hw.ramSize=1024
hw.keyboard.lid=no
hw.mainKeys=no
</pre>
      <li>Add the bitmap files of the device images to the skin folder. </li>
      <li>Archive the files in the skin folder. </li>
      <li>Create a new AVD and select the archive file as a custom skin. </li>
    </ol>

<p>You can now run the AVD with a custom skin for testing and viewing your app. </p>