blob: ebf95ce693743c93986cd51ff161ee8ac233db68 [file] [log] [blame]
Robert Ly6ffacae2010-12-16 17:50:43 -08001page.title=android
2@jd:body
3
4<p>{@code android} is an important development tool that lets you:</p>
5
6 <ul>
7 <li>Create, delete, and view Android Virtual Devices (AVDs). See <a href=
8 "{@docRoot}guide/developing/devices/managing-avds-cmdline.html">
9 Creating and Managing AVDs on the Command Line</a>.</li>
10
11 <li>Create and update Android projects. See <a href=
12 "{@docRoot}guide/developing/projects/projects-cmdline.html">Creating and Managing Projects on
13 the Command Line</a>.</li>
14
15 <li>Update your Android SDK with new platforms, add-ons, and documentation. See <a href=
16 "{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</li>
17 </ul>If you are using Eclipse, the <code>android</code> tool's features are integrated
18 into ADT, so you should not need to use this tool directly.
19
20 <h2>Syntax</h2>
21 <pre>android [global options] action [action options]</pre>
22
23 <h3>Global Options</h3>
24
25 <dl>
26 <dt><code>-s</code></dt>
27
28 <dd>Silent mode: only errors are printed out</dd>
29
30 <dt><code>-h</code></dt>
31
32 <dd>Usage help</dd>
33
34 <dt><code>-v</code></dt>
35
36 <dd>Verbose mode: errors, warnings and informational messages are printed.</dd>
37 </dl>
38
39 <h3>AVD actions and options</h3>
40
41 <table>
42 <tr>
43 <th width="15%">Action</th>
44
45 <th width="20%">Option</th>
46
47 <th width="30%">Description</th>
48
49 <th>Comments</th>
50 </tr>
51
52 <tr>
53 <td rowspan="6"><code>create avd</code></td>
54
55 <td><code>-n &lt;name&gt;</code></td>
56
57 <td>The name for the AVD.</td>
58
59 <td>Required</td>
60 </tr>
61
62 <tr>
63 <td><code>-t &lt;targetID&gt;</code></td>
64
65 <td>Target ID of the system image to use with the new AVD. To obtain a list of available
66 targets, use <code>android list targets</code></td>
67
68 <td>Required</td>
69 </tr>
70
71 <tr>
72 <td><code>-c &lt;path&gt;|&lt;size&gt;[K|M]</code></td>
73
74 <td>The path to the SD card image to use with this AVD or the size of a new SD card image to
75 create for this AVD. For example, <code>-c path/to/sdcard</code> or <code>-c
76 1000M</code>.</td>
77
78 <td></td>
79 </tr>
80
81 <tr>
82 <td><code>-f</code></td>
83
84 <td>Force creation of the AVD</td>
85
86 <td></td>
87 </tr>
88
89 <tr>
90 <td><code>-p &lt;path&gt;</code></td>
91
92 <td>Path to the location at which to create the directory for this AVD's files.</td>
93
94 <td></td>
95 </tr>
96
97 <tr>
98 <td><code>-s &lt;name&gt;|&lt;width&gt;-&lt;height&gt;</code></td>
99
100 <td>The skin to use for this AVD, identified by name or dimensions. The <code>android</code>
101 tool scans for a matching skin by name or dimension in the <code>skins/</code> directory of
102 the target referenced in the <code>-t &lt;targetID&gt;</code> argument. For example, <code>-s
103 HVGA-L</code></td>
104
105 <td></td>
106 </tr>
107
108 <tr>
109 <td><code>delete avd</code></td>
110
111 <td><code>-n &lt;name&gt;</code></td>
112
113 <td>The name of the AVD to delete</td>
114
115 <td>Required</td>
116 </tr>
117
118 <tr>
119 <td rowspan="3"><code>move avd</code></td>
120
121 <td><code>-n &lt;name&gt;</code></td>
122
123 <td>The name of the AVD to move</td>
124
125 <td>Required</td>
126 </tr>
127
128 <tr>
129 <td><code>-p &lt;path&gt;</code></td>
130
131 <td>Path to the location at which to create the directory for this AVD's files.</td>
132
133 <td></td>
134 </tr>
135
136 <tr>
137 <td><code>-r &lt;new-name&gt;</code></td>
138
139 <td>New name of the AVD if you want to rename it</td>
140
141 <td></td>
142 </tr>
143
144 <tr>
145 <td><code>update avd</code></td>
146
147 <td><code>-n &lt;name&gt;</code></td>
148
149 <td>The name of the AVD to move</td>
150
151 <td>Required</td>
152 </tr>
153 </table>
154
155 <h3>Project actions and options</h3>
156
157 <table>
158 <tr>
159 <th width="15%">Action</th>
160
161 <th width="20%">Option</th>
162
163 <th width="30%">Description</th>
164
165 <th>Comments</th>
166 </tr>
167
168 <tr>
169 <td rowspan="5"><code>create project</code></td>
170
171 <td><code>-n &lt;name&gt;</code></td>
172
173 <td>The name for the project</td>
174
175 <td>Required</td>
176 </tr>
177
178 <tr>
179 <td><code>-t &lt;targetID&gt;</code></td>
180
181 <td>Target ID of the system image to use with the new AVD. To obtain a list of available
182 targets, use <code>android list targets</code></td>
183
184 <td>Required</td>
185 </tr>
186
187 <tr>
188 <td><code>-k &lt;path&gt;|&lt;size&gt;[K|M]</code></td>
189
190 <td>Package namespace</td>
191
192 <td>Required</td>
193 </tr>
194
195 <tr>
196 <td><code>-a</code></td>
197
198 <td>Name for the default Activity class</td>
199
200 <td>Required</td>
201 </tr>
202
203 <tr>
204 <td><code>-p &lt;path&gt;</code></td>
205
206 <td>Location of your project directory</td>
207
208 <td>Required</td>
209 </tr>
210
211 <tr>
212 <td rowspan="5"><code>update project</code></td>
213
214 <td><code>-n &lt;name&gt;</code></td>
215
216 <td>The name of the project to update</td>
217
218 <td></td>
219 </tr>
220
221 <tr>
222 <td><code>-p &lt;path&gt;</code></td>
223
224 <td>Location path of the project</td>
225
226 <td>Required</td>
227 </tr>
228
229 <tr>
230 <td><code>-l &lt;library path&gt;</code></td>
231
232 <td>Location path of an Android Library to add, relative to the main project</td>
233
234 <td></td>
235 </tr>
236
237 <tr>
238 <td><code>-s &lt;subprojects&gt;</code></td>
239
240 <td>Update any projects in subfolders such as test projects</td>
241
242 <td></td>
243 </tr>
244
245 <tr>
246 <td><code>-t &lt;targetID&gt;</code></td>
247
248 <td>Target id to set for the project</td>
249
250 <td></td>
251 </tr>
252
253 <tr>
254 <td rowspan="3"><code>create-test-project</code></td>
255
256 <td><code>-n &lt;name&gt;</code></td>
257
258 <td>The name of the project</td>
259
260 <td></td>
261 </tr>
262
263 <tr>
264 <td><code>-p &lt;path&gt;</code></td>
265
266 <td>Location path of the project</td>
267
268 <td>Required</td>
269 </tr>
270
271 <tr>
272 <td><code>-m &lt;main&gt;</code></td>
273
274 <td>The name of the project</td>
275
276 <td>Required</td>
277 </tr>
278
279 <tr>
280 <td rowspan="2"><code>update-test-project</code></td>
281
282 <td><code>-p &lt;path&gt;</code></td>
283
284 <td>Location path of the project to test, relative to the new project</td>
285
286 <td>Required</td>
287 </tr>
288
289 <tr>
290 <td><code>-m &lt;main&gt;</code></td>
291
292 <td>The main class of the project to test</td>
293
294 <td>Required</td>
295 </tr>
296
297 <tr>
298 <td rowspan="4"><code>create-lib-project</code></td>
299
300 <td><code>-k &lt;packageName&gt;</code></td>
301
302 <td>(Required) Package name of the library project</td>
303
304 <td>Required</td>
305 </tr>
306
307 <tr>
308 <td><code>-p &lt;path&gt;</code></td>
309
310 <td>Location path of the project</td>
311
312 <td>Required</td>
313 </tr>
314
315 <tr>
316 <td><code>-t &lt;targetID&gt;</code></td>
317
318 <td>Target ID of the library project</td>
319
320 <td>Required</td>
321 </tr>
322
323 <tr>
324 <td><code>-n &lt;name&gt;</code></td>
325
326 <td>The name of the project</td>
327
328 <td>Required</td>
329 </tr>
330
331 <tr>
332 <td rowspan="3"><code>update-lib-project</code></td>
333
334 <td><code>-p &lt;path&gt;</code></td>
335
336 <td>Location path of the project</td>
337
338 <td>Required</td>
339 </tr>
340
341 <tr>
342 <td><code>-l &lt;libraryPath&gt;</code></td>
343
344 <td>Location path of an Android Library to add, relative to the main project</td>
345
346 <td></td>
347 </tr>
348
349 <tr>
350 <td><code>-t &lt;name&gt;</code></td>
351
352 <td>Target ID of the library project</td>
353
354 <td></td>
355 </tr>
356 </table>
357
358 <h3>Update actions</h3>
359 <dl>
360 <dt><code>update adb</code></dt>
361 <dd>Updates adb to support the USB devices declared in the SDK add-ons.</dd>
362
363 <dt><code>update sdk</code></dt>
364 <dd>Updates the SDK by suggesting new platforms to install if available.</dd>