blob: 90e90457f97f05bf28cc06c9d9c9c0b8ffdb2eef [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>
9 <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
25<p>Adding and updating components in your Android SDK is fast and easy. To
26perform an update, use the <strong>Android SDK and AVD Manager</strong> to
27install or update the individual SDK components that you need. The Android SDK
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070028and AVD Manager tool is included in the <a href="index.html">Android SDK
29download</a>.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070030
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070031<p>It only takes a couple of clicks to install individual versions of the
32Android platform, new development tools, new documentation, and SDK add-ons. The
33new SDK components are automatically installed into your existing SDK directory,
34so you don't need to update your development environment to specify a new SDK
35location.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070036
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070037<p>Because each version of the Android platform can be installed as an
38individual component of your SDK, you can customize your development environment
39to the Android platforms you are targetting. Testing your app on multiple
40versions of the platform is very important in order to successfully operate on
41as many devices as possible. Be sure to install each version of the Android
42platform with which your app is compatible, then test your apps on <a
43href="{@docRoot}guide/developing/tools/avd.html">AVDs</a> that run each
44platform.</p>
45
46<p>If you are just getting started and you are not sure what components to install,
47see <a href="installing.html#components">Adding Platforms and Other
48Components</a> for information. </p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070049
50<p>If you develop applications using Eclipse, you may also need to update your
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070051ADT plugin when you update your development tools, in order to compile against
52a new version of the platform. See the revisions listed in the <a
53href="{@docRoot}sdk/tools-notes.html">SDK Tools</a> document for ADT
54Plugin compatibility.</p>
55
56<div style="TEXT-ALIGN:left; width:600px;">
57<img src="{@docRoot}images/sdk_manager_packages.png"
58style="padding-bottom:0;margin-bottom:0;" />
59<p class="caption" style="margin:0 0 1.5em 1em;padding:0 0 0
601em;"><strong>Figure 1.</strong> The Android SDK and AVD Manager's
61<strong>Available Packages</strong>
62panel, which shows the SDK components that are
63available for you to download into your environment. </p>
64</div>
65
66<h2 id="launching">Launching the Android SDK and AVD Manager</h2>
67
68<p>The Android SDK and AVD Manager is the tool that you use to install and
69upgrade SDK components in your development environment. </p>
70
71<p>You can access the tool in any of three ways:</p>
72<ul>
73<li>If you are developing in the Eclipse IDE with the ADT Plugin, you can access
74the tool directly from the Eclipse UI.</li>
75<li>On Windows only, you can launch he tool by double-clicking a script file.</li>
76<li>In all environments, you can access the tool from a command line.</li>
77</ul>
78
79<h4>Launching from Eclipse/ADT</h4>
80
81<p>If you are developing in Eclipse and have already installed the ADT Plugin,
82follow these steps to access the Android SDK and AVD Manager tool:</p>
83
84<ol>
85<li>Open Eclipse</li>
86<li>Select <strong>Window</strong> &gt; <strong>Android SDK and AVD
87Manager</strong>.</li>
88</ol>
89
90<h4>Launching from the setup script (Windows only)</h4>
91
92<p>For Windows only, the SDK includes a script that invokes the Android SDK and
93AVD Manager. To launch the tool using the script, double-click "SDK
94Setup.exe" at the root of the the SDK directory.</p>
95
96<h4>Launching from a command line</h4>
97
98<p>In all development environments, follow these steps to access the Android SDK
99and AVD Manager tool from the command line: </p>
100
101<ol>
102<li>Navigate to the <code>&lt;<em>sdk</em>&gt;/tools/</code> directory.</li>
103<li>Execute the {@code android} tool command with no options.
104 <pre style="width:400px">$ android</pre></li>
105</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700106
107
108<h2 id="InstallingComponents">Installing SDK Components</h2>
109
Dirk Doughertya374f512009-11-09 11:41:09 -0800110<p class="caution"><strong>Important:</strong> Before you install SDK components,
111we recommend that you disable any antivirus programs that may be running on
112your computer.</p>
113
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700114<p>Follow these steps to install new SDK components in your environment:</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700115
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700116<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700117 <li>Launch the Android SDK and AVD Manager as described in the section above.</li>
118 <li>Select <strong>Available Packages</strong> in the left panel.
119 This will reveal all of the components that are currently available for download
120 from the SDK repository.</li>
121 <li>Select the component(s) you'd like to install and click <strong>Install
122 Selected</strong>. If you aren't sure which packages to select, read <a
123 href="installing.html#which">Which components do I need?</a>.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700124 <li>Verify and accept the components you want and click <strong>Install
125 Accepted</strong>. The components will now be installed into your existing
126 Android SDK directories.</li>
127</ol>
128
129<p>New platforms are automatically saved into the
130<code><em>&lt;sdk>/</em>platforms/</code> directory of your SDK;
131new add-ons are saved in the <code><em>&lt;sdk>/</em>add-ons/</code>
132directory; and new documentation is saved in the existing
133<code><em>&lt;sdk>/</em>docs/</code> directory (old docs are replaced).</p>
134
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700135
136<h2 id="UpdatingComponents">Updating SDK Components</h2>
137
138<p>From time to time, new revisions of existing SDK components are released and
139made available to you through the SDK repository. In most cases, if you have those
140components installed in your environment, you will want
141to download the new revisions as soon as possible. </p>
142
143<p>You can learn about the release of new revisions in two ways: </p>
144
145<ul>
146<li>You can watch for updates listed in the "SDK" tab of the Android Developers
147site, in the "Downloadable SDK Components" section. </li>
148<li>You can watch for updates listed in the <strong>Available Packages</strong>
149panel of the Android SDK and AVD Manager. </li>
150</ul>
151
152<p>When you see that a new revision is available, you can use the Android SDK
153and AVD Manager to quickly download it to your environment. Follow the same
154procedure as given in <a href="">Installing SDK Components</a>, above. The new
155component is installed in place of the old, but without impacting your
156applications. </p>
157
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700158<p class="note"><strong>Tip:</strong>
159Use the "Display updates only" checkbox to show only the components
160you do not have.</p>
161
162
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700163<h2 id="dependencies">SDK Component Dependencies</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700164
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700165<p>In some cases, an SDK component may require a specific minimum revision of
166another component or SDK tool. Where such dependencies exist, they are
167documented in the revision notes for each component, available from the links in
168the "Downloadable SDK Components" section at left.</p>
169
170<p>For example, there may be a dependency between the ADT Plugin for Eclipse and
171the SDK Tools component. When you install the SDK Tools
172component, you would then need to upgrade to the required version of ADT (if you
173are developing in Eclipse). In this case, you would find dependencies listed in
174"Revisions" section of the <a href="{@docRoot}sdk/eclipse-adt.html#notes">ADT
175Plugin Notes</a> and <a href="{@docRoot}sdk/tools-notes.html#notes">SDK Tools
176Notes</a> documents. </p>
177
178<p>Additionally, the development tools will notify you with debug warnings
179if there is dependency that you need to address. </p>
180
181
182<h2 id="AddingSites">Adding New Sites</h2>
183
184<p>By default, <strong>Available Packages</strong> only shows the default
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700185repository site, which offers platforms, SDK tools, documentation, the
186Google APIs Add-on, and other components. You can add other sites that host
187their own Android SDK add-ons, then download the SDK add-ons
188from those sites.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700189
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700190<p>For example, a mobile carrier or device manufacturer might offer additional
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700191API libraries that are supported by their own Android-powered devices. In order
192to develop using their libraries, you must install their Android SDK add-on. </p>
193
194<p>If a carrier or device manufacturer has hosted an SDK add-on repository file
195on their web site, follow these steps to add their site to the SDK and AVD
196Manager:</p>
197
198<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700199 <li>Select <strong>Available Packages</strong> in the left panel.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700200 <li>Click <strong>Add Site</strong> and enter the URL of the
201{@code repository.xml} file. Click <strong>OK</strong>.</li>
202</ol>
203<p>Any SDK components available from the site will now be listed under
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700204<strong>Available Packages</strong>.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700205
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700206<h2 id="troubleshooting">Troubleshooting</h2>
Dirk Dougherty83d09252010-01-12 17:54:25 -0800207
208<p><strong>Problems connecting to the SDK repository</strong></p>
209
210<p>If you are using the SDK and AVD Manager to download components and are encountering
211connection problems, try connecting over http, rather than https. To switch the
212protocol used by the SDK and AVD Manager, follow these steps: </p>
213
214<ol>
215 <li>With the Android SDK and AVD Manager window open, select "Settings" in the
216 left pane. </li>
217 <li>On the right, in the "Misc" section, check the checkbox labeled "Force
218 https://... sources to be fetched using http://..." </li>
219 <li>Click <strong>Save &amp; Apply</strong>.</li>
220</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700221
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700222