summaryrefslogtreecommitdiffstats
path: root/docs/html/guide/developing/tools/android.jd
blob: a67012f11d36dd46d567fc1b49181baa796e475e (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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
page.title=android
parent.title=Tools
parent.link=index.html
@jd:body

<p>{@code android} is an important development tool that lets you:</p>

  <ul>
    <li>Create, delete, and view Android Virtual Devices (AVDs). See <a href= 
    "{@docRoot}guide/developing/devices/managing-avds-cmdline.html">Managing AVDs from the Command
Line</a>.</li>

    <li>Create and update Android projects. See <a href= 
    "{@docRoot}guide/developing/projects/projects-cmdline.html">Managing Projects from
    the Command Line</a>.</li>

    <li>Update your Android SDK with new platforms, add-ons, and documentation. See <a href= 
    "{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</li>
  </ul>If you are using Eclipse, the <code>android</code> tool's features are integrated
  into ADT, so you should not need to use this tool directly.

  <h2>Syntax</h2>
  <pre>android [global options] action [action options]</pre>

  <h3>Global Options</h3>

  <dl>
    <dt><code>-s</code></dt>

    <dd>Silent mode: only errors are printed out</dd>

    <dt><code>-h</code></dt>

    <dd>Usage help</dd>

    <dt><code>-v</code></dt>

    <dd>Verbose mode: errors, warnings and informational messages are printed.</dd>
  </dl>

  <h3>AVD actions and options</h3>

  <table>
    <tr>
      <th width="15%">Action</th>

      <th width="20%">Option</th>

      <th width="30%">Description</th>

      <th>Comments</th>
    </tr>

    <tr>
      <td rowspan="6"><code>create avd</code></td>

      <td><code>-n &lt;name&gt;</code></td>

      <td>The name for the AVD.</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-t &lt;targetID&gt;</code></td>

      <td>Target ID of the system image to use with the new AVD. To obtain a list of available
      targets, use <code>android list targets</code></td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-c &lt;path&gt;|&lt;size&gt;[K|M]</code></td>

      <td>The path to the SD card image to use with this AVD or the size of a new SD card image to
      create for this AVD. For example, <code>-c path/to/sdcard</code> or <code>-c
      1000M</code>.</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-f</code></td>

      <td>Force creation of the AVD</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-p &lt;path&gt;</code></td>

      <td>Path to the location at which to create the directory for this AVD's files.</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-s &lt;name&gt;|&lt;width&gt;-&lt;height&gt;</code></td>

      <td>The skin to use for this AVD, identified by name or dimensions. The <code>android</code>
      tool scans for a matching skin by name or dimension in the <code>skins/</code> directory of
      the target referenced in the <code>-t &lt;targetID&gt;</code> argument. For example, <code>-s
      HVGA-L</code></td>

      <td></td>
    </tr>

    <tr>
      <td><code>delete avd</code></td>

      <td><code>-n &lt;name&gt;</code></td>

      <td>The name of the AVD to delete</td>

      <td>Required</td>
    </tr>

    <tr>
      <td rowspan="3"><code>move avd</code></td>

      <td><code>-n &lt;name&gt;</code></td>

      <td>The name of the AVD to move</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-p &lt;path&gt;</code></td>

      <td>Path to the location at which to create the directory for this AVD's files.</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-r &lt;new-name&gt;</code></td>

      <td>New name of the AVD if you want to rename it</td>

      <td></td>
    </tr>

    <tr>
      <td><code>update avd</code></td>

      <td><code>-n &lt;name&gt;</code></td>

      <td>The name of the AVD to move</td>

      <td>Required</td>
    </tr>
  </table>

  <h3>Project actions and options</h3>

  <table>
    <tr>
      <th width="15%">Action</th>

      <th width="20%">Option</th>

      <th width="30%">Description</th>

      <th>Comments</th>
    </tr>

    <tr>
      <td rowspan="5"><code>create project</code></td>

      <td><code>-n &lt;name&gt;</code></td>

      <td>The name for the project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-t &lt;targetID&gt;</code></td>

      <td>Target ID of the system image to use with the new AVD. To obtain a list of available
      targets, use <code>android list targets</code></td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-k &lt;path&gt;|&lt;size&gt;[K|M]</code></td>

      <td>Package namespace</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-a</code></td>

      <td>Name for the default Activity class</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-p &lt;path&gt;</code></td>

      <td>Location of your project directory</td>

      <td>Required</td>
    </tr>

    <tr>
      <td rowspan="5"><code>update project</code></td>

      <td><code>-n &lt;name&gt;</code></td>

      <td>The name of the project to update</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-p &lt;path&gt;</code></td>

      <td>Location path of the project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-l &lt;library path&gt;</code></td>

      <td>Location path of an Android Library to add, relative to the main project</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-s &lt;subprojects&gt;</code></td>

      <td>Update any projects in subfolders such as test projects</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-t &lt;targetID&gt;</code></td>

      <td>Target id to set for the project</td>

      <td></td>
    </tr>

    <tr>
      <td rowspan="3"><code>create-test-project</code></td>

      <td><code>-n &lt;name&gt;</code></td>

      <td>The name of the project</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-p &lt;path&gt;</code></td>

      <td>Location path of the project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-m &lt;main&gt;</code></td>

      <td>The name of the project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td rowspan="2"><code>update-test-project</code></td>

      <td><code>-p &lt;path&gt;</code></td>

      <td>Location path of the project to test, relative to the new project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-m &lt;main&gt;</code></td>

      <td>The main class of the project to test</td>

      <td>Required</td>
    </tr>

    <tr>
      <td rowspan="4"><code>create-lib-project</code></td>

      <td><code>-k &lt;packageName&gt;</code></td>

      <td>(Required) Package name of the library project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-p &lt;path&gt;</code></td>

      <td>Location path of the project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-t &lt;targetID&gt;</code></td>

      <td>Target ID of the library project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-n &lt;name&gt;</code></td>

      <td>The name of the project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td rowspan="3"><code>update-lib-project</code></td>

      <td><code>-p &lt;path&gt;</code></td>

      <td>Location path of the project</td>

      <td>Required</td>
    </tr>

    <tr>
      <td><code>-l &lt;libraryPath&gt;</code></td>

      <td>Location path of an Android Library to add, relative to the main project</td>

      <td></td>
    </tr>

    <tr>
      <td><code>-t &lt;name&gt;</code></td>

      <td>Target ID of the library project</td>

      <td></td>
    </tr>
  </table>

  <h3>Update actions</h3>
  <dl>
  <dt><code>update adb</code></dt>
  <dd>Updates adb to support the USB devices declared in the SDK add-ons.</dd>
   
  <dt><code>update sdk</code></dt>
  <dd>Updates the SDK by suggesting new platforms to install if available.</dd>