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