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