blob: ca27bbad0a727aee66b1ce3b00f80bbcf306e945 [file] [log] [blame]
Dirk Doughertyee58d1b2009-10-16 15:25:15 -07001page.title=Adding SDK Components
2@jd:body
3
4
5<div id="qv-wrapper">
6<div id="qv">
7<h2>Quickview</h2>
8<ul>
Scott Main06cf15e2010-10-28 00:02:31 -07009 <li>Use the Android SDK and AVD Manager to
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070010 set up your SDK and keep it up-to-date.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070011</ul>
12
13<h2>In this document</h2>
14<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070015 <li><a href="#launching">Launching the Android SDK and AVD Manager</a>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070016 <li><a href="#InstallingComponents">Installing SDK Components</a>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070017 <li><a href="#UpdatingComponents">Updating SDK Components</a>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070018 <li><a href="#dependencies">Component Dependencies</a></li>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070019 <li><a href="#AddingSites">Adding New Sites</a></li>
20 <li><a href="#troubleshooting">Troubleshooting</a></li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070021</ol>
22</div>
23</div>
24
Scott Main38dea272010-11-01 13:03:25 -070025<p>Adding and updating components in your Android SDK is fast and easy. To add or
26update the individual SDK components that you need, use the <em>Android SDK and AVD
27Manager</em> (included in the SDK Tools).</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070028
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070029<p>It only takes a couple of clicks to install individual versions of the
30Android platform, new development tools, new documentation, and SDK add-ons. The
31new SDK components are automatically installed into your existing SDK directory,
32so you don't need to update your development environment to specify a new SDK
33location.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070034
Scott Main38dea272010-11-01 13:03:25 -070035<p>If you're setting up your Android SDK for the first time,
36see <a href="{@docRoot}sdk/installing.html#components">Installing the SDK</a> for information about
37what components to install.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070038
Scott Main38dea272010-11-01 13:03:25 -070039<p class="note"><strong>Note:</strong> If you develop in Eclipse, you might also need
40to update your ADT plugin when you update your development tools. See the revisions listed in the
41<a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a> document.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070042
Scott Main38dea272010-11-01 13:03:25 -070043<img src="{@docRoot}images/sdk_manager_packages.png" alt="" />
44<p class="img-caption"><strong>Figure 1.</strong> The Android SDK and AVD Manager's
45<strong>Available Packages</strong> panel, which shows the SDK components that are
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070046available for you to download into your environment. </p>
Scott Main06cf15e2010-10-28 00:02:31 -070047</div>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070048
49<h2 id="launching">Launching the Android SDK and AVD Manager</h2>
50
Scott Main06cf15e2010-10-28 00:02:31 -070051<p>The Android SDK and AVD Manager is the tool that you use to install and
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070052upgrade SDK components in your development environment. </p>
53
Scott Main38dea272010-11-01 13:03:25 -070054<p>You can launch the Android SDK and AVD Manager in one of the following ways.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070055
56<h4>Launching from Eclipse/ADT</h4>
57
58<p>If you are developing in Eclipse and have already installed the ADT Plugin,
59follow these steps to access the Android SDK and AVD Manager tool:</p>
60
61<ol>
62<li>Open Eclipse</li>
Scott Main06cf15e2010-10-28 00:02:31 -070063<li>Select <strong>Window</strong> &gt; <strong>Android SDK and AVD
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070064Manager</strong>.</li>
65</ol>
66
Scott Main06cf15e2010-10-28 00:02:31 -070067<h4>Launching from the SDK Manager script (Windows only)</h4>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070068
69<p>For Windows only, the SDK includes a script that invokes the Android SDK and
Scott Main06cf15e2010-10-28 00:02:31 -070070AVD Manager. To launch the tool using the script, double-click {@code SDK
71Manager.exe} at the root of the the SDK directory.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070072
73<h4>Launching from a command line</h4>
74
75<p>In all development environments, follow these steps to access the Android SDK
76and AVD Manager tool from the command line: </p>
77
78<ol>
79<li>Navigate to the <code>&lt;<em>sdk</em>&gt;/tools/</code> directory.</li>
Scott Main06cf15e2010-10-28 00:02:31 -070080<li>Execute the {@code android} tool command with no options.
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070081 <pre style="width:400px">$ android</pre></li>
82</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070083
84
85<h2 id="InstallingComponents">Installing SDK Components</h2>
86
Scott Main06cf15e2010-10-28 00:02:31 -070087<p class="caution"><strong>Caution:</strong> Before you install SDK components,
88we recommend that you disable any antivirus software that may be running on
89your computer. There are cases in which antivirus software on Windows is known to interfere with the
90installation process, so we suggest you disable your antivirus until installation is
91complete.</p>
Dirk Doughertya374f512009-11-09 11:41:09 -080092
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070093<p>Follow these steps to install new SDK components in your environment:</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070094
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070095<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070096 <li>Launch the Android SDK and AVD Manager as described in the section above.</li>
97 <li>Select <strong>Available Packages</strong> in the left panel.
Scott Main06cf15e2010-10-28 00:02:31 -070098 This will reveal all of the components that are currently available for download
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070099 from the SDK repository.</li>
100 <li>Select the component(s) you'd like to install and click <strong>Install
Scott Main4fb51ca2010-11-09 14:47:15 -0800101 Selected</strong>. (If you aren't sure which packages to select, read <a
102 href="installing.html#which">Recommended Components</a>.)</li>
103 <li>Verify and accept the components you want (ensure each one is selected with a green
104checkmark) and click <strong>Install</strong>. The components will now be installed into
105your existing Android SDK directories.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700106</ol>
107
Scott Main06cf15e2010-10-28 00:02:31 -0700108<p>New platforms are automatically saved into the
Scott Main4fb51ca2010-11-09 14:47:15 -0800109<code>&lt;sdk&gt;/platforms/</code> directory of your SDK;
110new add-ons are saved in the <code>&lt;sdk&gt;/add-ons/</code>
Scott Main06cf15e2010-10-28 00:02:31 -0700111directory; samples are saved in the
Scott Main4fb51ca2010-11-09 14:47:15 -0800112<code>&lt;sdk&gt;/samples/android-&lt;level&gt;/</code>;
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700113and new documentation is saved in the existing
Scott Main4fb51ca2010-11-09 14:47:15 -0800114<code>&lt;sdk&gt;/docs/</code> directory (old docs are replaced).</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700115
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700116
117<h2 id="UpdatingComponents">Updating SDK Components</h2>
118
119<p>From time to time, new revisions of existing SDK components are released and
120made available to you through the SDK repository. In most cases, if you have those
121components installed in your environment, you will want
122to download the new revisions as soon as possible. </p>
123
124<p>You can learn about the release of new revisions in two ways: </p>
125
126<ul>
127<li>You can watch for updates listed in the "SDK" tab of the Android Developers
128site, in the "Downloadable SDK Components" section. </li>
129<li>You can watch for updates listed in the <strong>Available Packages</strong>
130panel of the Android SDK and AVD Manager. </li>
131</ul>
132
133<p>When you see that a new revision is available, you can use the Android SDK
134and AVD Manager to quickly download it to your environment. Follow the same
Scott Main93d204e2010-12-06 15:19:37 -0800135procedure as given in <a href="#InstallingComponents">Installing SDK Components</a>, above. The new
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700136component is installed in place of the old, but without impacting your
137applications. </p>
138
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700139<p class="note"><strong>Tip:</strong>
140Use the "Display updates only" checkbox to show only the components
141you do not have.</p>
142
143
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700144<h2 id="dependencies">SDK Component Dependencies</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700145
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700146<p>In some cases, an SDK component may require a specific minimum revision of
147another component or SDK tool. Where such dependencies exist, they are
148documented in the revision notes for each component, available from the links in
149the "Downloadable SDK Components" section at left.</p>
150
151<p>For example, there may be a dependency between the ADT Plugin for Eclipse and
152the SDK Tools component. When you install the SDK Tools
Scott Maindfb12212010-11-10 11:59:33 -0800153component, you should also upgrade to the required version of ADT (if you
154are developing in Eclipse). In this case, the major version number for your ADT plugin should
155always match the revision number of your SDK Tools (for example, ADT 8.x requires SDK Tools r8).
156</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700157
Scott Maindfb12212010-11-10 11:59:33 -0800158<p>Also make sure that, each time you install a new version of the Android platform, you have
159the latest version of the SDK Platform-tools component. The SDK Platform-tools contain
160tools that are backward compatible with all versions of the Android platform and are
161often updated to support new features in the latest version of the Android platform.</p>
162
163<p>The development tools will notify you with debug warnings if there is dependency that you need to
164address. The SDK and AVD Manager also enforces dependencies by requiring that you download any
165components that are needed by those you have selected.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700166
167
168<h2 id="AddingSites">Adding New Sites</h2>
169
Scott Main4fb51ca2010-11-09 14:47:15 -0800170<p>By default, <strong>Available Packages</strong> displays components available from the
171<em>Android Repository</em> and <em>Third party Add-ons</em>. You can add other sites that host
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700172their own Android SDK add-ons, then download the SDK add-ons
Scott Main06cf15e2010-10-28 00:02:31 -0700173from those sites.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700174
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700175<p>For example, a mobile carrier or device manufacturer might offer additional
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700176API libraries that are supported by their own Android-powered devices. In order
Scott Main4fb51ca2010-11-09 14:47:15 -0800177to develop using their libraries, you must install their Android SDK add-on, if it's not already
178available under <em>Third party Add-ons</em>. </p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700179
180<p>If a carrier or device manufacturer has hosted an SDK add-on repository file
181on their web site, follow these steps to add their site to the SDK and AVD
182Manager:</p>
183
184<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700185 <li>Select <strong>Available Packages</strong> in the left panel.</li>
Scott Main4fb51ca2010-11-09 14:47:15 -0800186 <li>Click <strong>Add Add-on Site</strong> and enter the URL of the
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700187{@code repository.xml} file. Click <strong>OK</strong>.</li>
188</ol>
Scott Main4fb51ca2010-11-09 14:47:15 -0800189<p>Any SDK components available from the site will now be listed under a new item named
190<strong>User Add-ons</strong>.</p>
191
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700192
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700193<h2 id="troubleshooting">Troubleshooting</h2>
Dirk Dougherty83d09252010-01-12 17:54:25 -0800194
195<p><strong>Problems connecting to the SDK repository</strong></p>
196
197<p>If you are using the SDK and AVD Manager to download components and are encountering
198connection problems, try connecting over http, rather than https. To switch the
199protocol used by the SDK and AVD Manager, follow these steps: </p>
200
201<ol>
202 <li>With the Android SDK and AVD Manager window open, select "Settings" in the
203 left pane. </li>
204 <li>On the right, in the "Misc" section, check the checkbox labeled "Force
205 https://... sources to be fetched using http://..." </li>
206 <li>Click <strong>Save &amp; Apply</strong>.</li>
207</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700208
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700209