1 page.title=SDK Manager 2 @jd:body 3 4 5 <p>The Android SDK separates tools, platforms, and other components into packages you can 6 download using the SDK Manager. For example, when the SDK Tools are updated or a new version of 7 the Android platform is released, you can use the SDK Manager to quickly download them to 8 your environment.</p> 9 10 <p>You can launch the SDK Manager in one of the following ways:</p> 11 <ul> 12 <li>From Eclipse (with <a href="{@docRoot}tools/help/adt.html">ADT</a>), 13 select <strong>Window</strong> > <strong>Android SDK Manager</strong>.</li> 14 <li>From Android Studio, select <strong>Tools</strong> > <strong>Android</strong> 15 > <strong>SDK Manager</strong>.</li> 16 <li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android 17 SDK directory.</li> 18 <li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the 19 Android SDK, then execute <code>android sdk</code>.</li> 20 </ul> 21 22 <p>You can select which packages you want to download by toggling the checkboxes on the left, then 23 click <strong>Install</strong> to install the selected packages.</p> 24 25 <img src="{@docRoot}images/sdk_manager_packages.png" alt="" /> 26 <p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager shows the 27 SDK packages that are available, already installed, or for which an update is available.</p> 28 29 30 <p>There are several different packages available for the Android SDK. The table below describes 31 most of the available packages and where they're located in your SDK directory 32 once you download them.</p> 33 34 35 36 37 38 <h2 id="Recommended">Recommended Packages</h2> 39 40 <p>Here's an outline of the packages required and those we recommend you use: 41 </p> 42 43 <dl> 44 <dt>SDK Tools</dt> 45 <dd><strong>Required.</strong> Your new SDK installation already has the latest version. Make sure 46 you keep this up to date.</dd> 47 <dt>SDK Platform-tools</dt> 48 <dd><strong>Required.</strong> You must install this package when you install the SDK for 49 the first time.</dd> 50 <dt>SDK Platform</dt> 51 <dd><strong>Required.</strong>You must download <em>at least one platform</em> into your 52 environment so you're able to compile your application. In order to provide the best user experience 53 on the latest devices, we recommend that you use the latest platform version as your build target. 54 You'll still be able to run your app on older versions, but you must build against the latest 55 version in order to use new features when running on devices with the latest version of Android. 56 <p>To get started, download the latest Android version, plus the lowest version you plan 57 to support (we recommend Android 2.2 for your lowest version).</p></dd> 58 <dt>System Image</dt> 59 <dd>Recommended. Although you might have one or more Android-powered devices on which to test 60 your app, it's unlikely you have a device for every version of Android your app supports. It's 61 a good practice to download system images for all versions of Android your app supports and test 62 your app running on them with the <a href="{@docRoot}tools/devices/emulator.html">Android emulator</a>.</dd> 63 <dt>Android Support</dt> 64 <dd>Recommended. Includes a static library that allows you to use some of the latest 65 Android APIs (such as <a href="{@docRoot}guide/components/fragments.html">fragments</a>, 66 plus others not included in the framework at all) on devices running 67 a platform version as old as Android 1.6. All of the activity templates available when creating 68 a new project with the <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> 69 require this. For more information, read <a 70 href="{@docRoot}tools/support-library/index.html">Support Library</a>.</dd> 71 <dt>SDK Samples</dt> 72 <dd>Recommended. The samples give you source code that you can use to learn about 73 Android, load as a project and run, or reuse in your own app. Note that multiple 74 samples packages are available — one for each Android platform version. When 75 you are choosing a samples package to download, select the one whose API Level 76 matches the API Level of the Android platform that you plan to use.</dd> 77 </dl> 78 79 <p class="note"><strong>Tip:</strong> For easy access to the SDK tools from a command line, add the 80 location of the SDK's <code>tools/</code> and 81 <code>platform-tools</code> to your <code>PATH</code> environment variable.</p> 82 83 84 <p>The above list is not comprehensive and you can <a 85 href="#AddingSites">add new sites</a> to download additional packages from third-parties.</p> 86 87 <p>In some cases, an SDK package may require a specific minimum revision of 88 another package or SDK tool. 89 The development tools will notify you with warnings if there is dependency that you need to 90 address. The Android SDK Manager also enforces dependencies by requiring that you download any 91 packages that are needed by those you have selected.</p> 92 93 94 95 96 97 <h2 id="AddingSites">Adding New Sites</h2> 98 99 <p>By default, <strong>Available Packages</strong> displays packages available from the 100 <em>Android Repository</em> and <em>Third party Add-ons</em>. You can add other sites that host 101 their own Android SDK add-ons, then download the SDK add-ons 102 from those sites.</p> 103 104 <p>For example, a mobile carrier or device manufacturer might offer additional 105 API libraries that are supported by their own Android-powered devices. In order 106 to develop using their libraries, you must install their Android SDK add-on, if it's not already 107 available under <em>Third party Add-ons</em>. </p> 108 109 <p>If a carrier or device manufacturer has hosted an SDK add-on repository file 110 on their web site, follow these steps to add their site to the Android SDK 111 Manager:</p> 112 113 <ol> 114 <li>Select <strong>Available Packages</strong> in the left panel.</li> 115 <li>Click <strong>Add Add-on Site</strong> and enter the URL of the 116 <code>repository.xml</code> file. Click <strong>OK</strong>.</li> 117 </ol> 118 <p>Any SDK packages available from the site will now be listed under a new item named 119 <strong>User Add-ons</strong>.</p> 120 121 122 123 124 <h2 id="troubleshooting">Troubleshooting</h2> 125 126 <p><strong>Problems connecting to the SDK repository</strong></p> 127 128 <p>If you are using the Android SDK Manager to download packages and are encountering 129 connection problems, try connecting over http, rather than https. To switch the 130 protocol used by the Android SDK Manager, follow these steps: </p> 131 132 <ol> 133 <li>With the Android SDK Manager window open, select "Settings" in the 134 left pane. </li> 135 <li>On the right, in the "Misc" section, check the checkbox labeled "Force 136 https://... sources to be fetched using http://..." </li> 137 <li>Click <strong>Save & Apply</strong>.</li> 138 </ol> 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156