blob: 599b2a831f62c8ed41a44bed113c5aad5354c0e9 [file] [log] [blame]
Scott Maina7b1b8c2012-03-14 17:16:11 -07001page.title=Adding SDK Packages
Dirk Doughertyee58d1b2009-10-16 15:25:15 -07002@jd:body
3
4
5<div id="qv-wrapper">
6<div id="qv">
7<h2>Quickview</h2>
8<ul>
Scott Maina7b1b8c2012-03-14 17:16:11 -07009 <li>Use the Android SDK 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>
Scott Maina7b1b8c2012-03-14 17:16:11 -070015 <li><a href="#launching">Launching the Android SDK Manager</a>
16 <li><a href="#InstallingComponents">Installing SDK Packages</a>
17 <li><a href="#UpdatingComponents">Updating SDK Packages</a>
18 <li><a href="#dependencies">Package 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 Maina7b1b8c2012-03-14 17:16:11 -070025<p>Adding and updating packages in your Android SDK is fast and easy. To add or
26update the individual SDK packages that you need, use the <em>Android SDK
Scott Main38dea272010-11-01 13:03:25 -070027Manager</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
Scott Maina7b1b8c2012-03-14 17:16:11 -070031new SDK packages are automatically installed into your existing SDK directory,
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070032so 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
Scott Maina7b1b8c2012-03-14 17:16:11 -070037what packages 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="" />
Scott Maina7b1b8c2012-03-14 17:16:11 -070044<p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager's
45<strong>Available Packages</strong> panel, which shows the SDK packages 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
Scott Maina7b1b8c2012-03-14 17:16:11 -070049<h2 id="launching">Launching the Android SDK Manager</h2>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070050
Scott Maina7b1b8c2012-03-14 17:16:11 -070051<p>The Android SDK Manager is the tool that you use to install and
52upgrade SDK packages in your development environment. </p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070053
Scott Maina7b1b8c2012-03-14 17:16:11 -070054<p>You can launch the Android SDK 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,
Scott Maina7b1b8c2012-03-14 17:16:11 -070059follow these steps to access the Android SDK Manager tool:</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070060
61<ol>
62<li>Open Eclipse</li>
Scott Maina7b1b8c2012-03-14 17:16:11 -070063<li>Select <strong>Window</strong> &gt; <strong>Android SDK
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
Scott Maina7b1b8c2012-03-14 17:16:11 -070069<p>For Windows only, the SDK includes a script that invokes the Android SDK Manager. To launch the
70tool using the script, double-click {@code SDK
Scott Main06cf15e2010-10-28 00:02:31 -070071Manager.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
Scott Maina7b1b8c2012-03-14 17:16:11 -070075<p>In all development environments, follow these steps to access the Android SDK Manager tool from
76the command line: </p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070077
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
Scott Maina7b1b8c2012-03-14 17:16:11 -070085<h2 id="InstallingComponents">Installing SDK Packages</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070086
Scott Maina7b1b8c2012-03-14 17:16:11 -070087<p class="caution"><strong>Caution:</strong> Before you install SDK packages,
Scott Main06cf15e2010-10-28 00:02:31 -070088we 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
Scott Maina7b1b8c2012-03-14 17:16:11 -070093<p>Follow these steps to install new SDK packages in your environment:</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070094
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070095<ol>
Scott Maina7b1b8c2012-03-14 17:16:11 -070096 <li>Launch the Android SDK Manager as described in the section above.</li>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070097 <li>Select <strong>Available Packages</strong> in the left panel.
Scott Maina7b1b8c2012-03-14 17:16:11 -070098 This will reveal all of the packages that are currently available for download
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070099 from the SDK repository.</li>
Scott Maina7b1b8c2012-03-14 17:16:11 -0700100 <li>Select the package(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
Scott Maina7b1b8c2012-03-14 17:16:11 -0700102 href="installing.html#which">Recommended Packages</a>.)</li>
103 <li>Verify and accept the packages you want (ensure each one is selected with a green
104checkmark) and click <strong>Install</strong>. The packages will now be installed into
Scott Main4fb51ca2010-11-09 14:47:15 -0800105your 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
Scott Maina7b1b8c2012-03-14 17:16:11 -0700117<h2 id="UpdatingComponents">Updating SDK Packages</h2>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700118
Scott Maina7b1b8c2012-03-14 17:16:11 -0700119<p>From time to time, new revisions of existing SDK packages are released and
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700120made available to you through the SDK repository. In most cases, if you have those
Scott Maina7b1b8c2012-03-14 17:16:11 -0700121packages installed in your environment, you will want
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700122to 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
Scott Maina7b1b8c2012-03-14 17:16:11 -0700128site, in the "Downloadable SDK Packages" section. </li>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700129<li>You can watch for updates listed in the <strong>Available Packages</strong>
Scott Maina7b1b8c2012-03-14 17:16:11 -0700130panel of the Android SDK Manager. </li>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700131</ul>
132
Scott Maina7b1b8c2012-03-14 17:16:11 -0700133<p>When you see that a new revision is available, you can use the Android SDK Manager to quickly
134download it to your environment. Follow the same
135procedure as given in <a href="#InstallingComponents">Installing SDK Packages</a>, above. The new
136package is installed in place of the old, but without impacting your
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700137applications. </p>
138
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700139<p class="note"><strong>Tip:</strong>
Scott Maina7b1b8c2012-03-14 17:16:11 -0700140Use the "Display updates only" checkbox to show only the packages
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700141you do not have.</p>
142
143
Scott Maina7b1b8c2012-03-14 17:16:11 -0700144<h2 id="dependencies">SDK Package Dependencies</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700145
Scott Maina7b1b8c2012-03-14 17:16:11 -0700146<p>In some cases, an SDK package may require a specific minimum revision of
147another package or SDK tool. Where such dependencies exist, they are
148documented in the revision notes for each package, available from the links in
149the "Downloadable SDK packages" section at left.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700150
151<p>For example, there may be a dependency between the ADT Plugin for Eclipse and
Scott Maina7b1b8c2012-03-14 17:16:11 -0700152the SDK Tools package. When you install the SDK Tools
153package, you should also upgrade to the required version of ADT (if you
Scott Maindfb12212010-11-10 11:59:33 -0800154are 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
Scott Maina7b1b8c2012-03-14 17:16:11 -0700159the latest version of the SDK Platform-tools package. The SDK Platform-tools contain
Scott Maindfb12212010-11-10 11:59:33 -0800160tools 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
Scott Maina7b1b8c2012-03-14 17:16:11 -0700164address. The Android SDK Manager also enforces dependencies by requiring that you download any
165packages 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 Maina7b1b8c2012-03-14 17:16:11 -0700170<p>By default, <strong>Available Packages</strong> displays packages available from the
Scott Main4fb51ca2010-11-09 14:47:15 -0800171<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
Scott Maina7b1b8c2012-03-14 17:16:11 -0700181on their web site, follow these steps to add their site to the Android SDK
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700182Manager:</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 Maina7b1b8c2012-03-14 17:16:11 -0700189<p>Any SDK packages available from the site will now be listed under a new item named
Scott Main4fb51ca2010-11-09 14:47:15 -0800190<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
Scott Maina7b1b8c2012-03-14 17:16:11 -0700197<p>If you are using the Android SDK Manager to download packages and are encountering
Dirk Dougherty83d09252010-01-12 17:54:25 -0800198connection problems, try connecting over http, rather than https. To switch the
Scott Maina7b1b8c2012-03-14 17:16:11 -0700199protocol used by the Android SDK Manager, follow these steps: </p>
Dirk Dougherty83d09252010-01-12 17:54:25 -0800200
201<ol>
Scott Maina7b1b8c2012-03-14 17:16:11 -0700202 <li>With the Android SDK Manager window open, select "Settings" in the
Dirk Dougherty83d09252010-01-12 17:54:25 -0800203 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