1page.title=Installing the Android SDK 2 3@jd:body 4 5<style> 6p.paging-links { 7 margin:0 0 40px; 8} 9.paging-links .next-page-link { 10 right:initial; 11} 12.procedure-box { 13 padding:20px 20px 5px; 14 margin-bottom:1em; 15 background:#eee; 16} 17.landing-button { 18 min-width: 155px; 19 text-align: center; 20} 21</style> 22 23 24 25<!-- ################### ADT BUNDLE ####################### --> 26<div id="adt" heading="Installing the Eclipse ADT Bundle" style="display:none"> 27 28 29<p>The Eclipse ADT Bundle provides everything you need to start developing apps, including 30the Android SDK tools and a version of the Eclipse IDE with built-in ADT 31(Android Developer Tools) to streamline your Android app development.</p> 32 33<p>If you didn't download the Eclipse ADT bundle, go <a href="{@docRoot}sdk/index.html" 34><b>download the Eclipse ADT bundle now</b></a>, or switch to the 35<a href="{@docRoot}sdk/installing/index.html?pkg=studio">Android Studio 36install</a> or <a href="{@docRoot}sdk/installing/index.html?pkg=tools">stand-alone SDK Tools 37install</a> instructions</i>.</p> 38 39<div class="procedure-box"> 40<p><b>To set up the ADT Bundle:</b></p> 41<ol> 42<li>Unpack the ZIP file 43(named {@code adt-bundle-<os_platform>.zip}) and save it to an appropriate location, 44such as a "Development" directory in your home directory.</li> 45<li>Open the {@code adt-bundle-<os_platform>/eclipse/} directory and launch 46<strong>Eclipse</strong>.</li> 47</ol> 48 49<p class="caution"><strong>Caution:</strong> Do not move any of the files or directories 50from the {@code adt-bundle-<os_platform>} directory. If you move the {@code eclipse/} 51or {@code sdk/} directory, ADT will not be able to locate the SDK and you'll 52need to manually update the ADT preferences.</p> 53</div> 54 55<p>Eclipse with ADT is now ready and loaded with the Android developer tools, but there are still 56a couple packages you should add to make your Android SDK complete.</p> 57 58<p class="paging-links"> 59<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> 60Continue: Adding SDK Packages</a></p> 61 62 63</div> 64<!-- ################ END ADT BUNDLE ##################### --> 65 66 67 68 69 70 71<!-- ################ STUDIO ##################### --> 72<div id="studio" heading="Installing Android Studio" style="display:none"> 73 74<p>Android Studio provides everything you need to start developing apps, including 75the Android SDK tools and the Android Studio IDE (powered by IntelliJ) to 76streamline your Android app development.</p> 77 78<p>If you didn't download Android Studio, go <a href="{@docRoot}sdk/installing/studio.html" 79><b>download Android Studio now</b></a>, or switch to the 80<a href="{@docRoot}sdk/installing/index.html?pkg=adt">Eclipse ADT 81install</a> or <a href="{@docRoot}sdk/installing/index.html?pkg=tools">stand-alone SDK Tools 82install</a> instructions.</p> 83 84 85<p>Before you set up Android Studio, be sure you have installed 86JDK 6 or greater (the JRE alone is not sufficient). To check if you 87have JDK installed (and which version), open a terminal and type <code>javac -version</code>. 88If the JDK is not available or the version is lower than 6, 89<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" class="external-link" 90>go download JDK</a>.</p> 91 92 93<div class="procedure-box"> 94 95<p id="instructions-toggle" 96style="float:right;font-size:13px"><a href='' onclick='showAll();return false;' 97>[ Show instructions for all platforms ]</a></p> 98 99<div class="win docs" style="display:none"> 100 101<p><b>To set up Android Studio on Windows:</b></p> 102 <ol> 103 <li>Launch the downloaded EXE file, {@code android-studio-bundle-<version>.exe}.</li> 104 <li>Follow the setup wizard to install Android Studio. 105 106 <p>On some Windows systems, the launcher script does not find where Java is installed. 107 If you encounter this problem, 108 you need to set an environment variable indicating the correct location.</p> 109 <p>Select <strong>Start menu > Computer > System Properties > 110 Advanced System Properties</strong>. Then open <strong>Advanced tab > Environment 111 Variables</strong> and add a new system variable <code>JAVA_HOME</code> that points to 112 your JDK folder, for example <code>C:\Program Files\Java\jdk1.7.0_21</code>.</p> 113 </p> 114 </li> 115 116 </ol> 117 118 119<p>The individual tools and 120other SDK packages are saved within the Android Studio application directory. 121If you need to access the tools directly, use a terminal to navigate into the application and locate 122the {@code sdk/} directory. For example:</p> 123<p><code>\Users\<user>\AppData\Local\Android\android-studio\sdk\</code></p> 124 125 126 127</div><!-- end windows --> 128 129 130<div class="mac docs" style="display:none"> 131 132<p><b>To set up Android Studio on Mac OSX:</b></p> 133 <ol> 134 <li>Open the downloaded DMG file, {@code android-studio-bundle-<version>.dmg}.</li> 135 <li>Drag and drop Android Studio into the Applications folder. 136 <p> 137 Depending on your security settings, when you attempt to open Android Studio, you might 138 see a warning that says the package is damaged and should be moved to the trash. If this 139 happens, go to <strong>System Preferences > Security & Privacy</strong> and under 140 <strong>Allow applications downloaded from</strong>, select <strong>Anywhere</strong>. 141 Then open Android Studio again.</p> 142 </li> 143 </ol> 144 145<p>The individual tools and 146other SDK packages are saved within the Android Studio application directory. 147If you need access the tools directly, use a terminal to navigate into the application and locate 148the {@code sdk/} directory. For example:</p> 149<p><code>/Applications/Android\ Studio.app/sdk/</code></p> 150 151 152</div><!-- end mac --> 153 154 155<div class="linux docs" style="display:none"> 156 157<p><b>To set up Android Studio on Linux:</b></p> 158 159 <ol> 160 <li>Unpack the downloaded Tar file, {@code android-studio-bundle-<version>.tgz}, into an appropriate 161 location for your applications. 162 <li>To launch Android Studio, navigate to the {@code android-studio/bin/} directory 163 in a terminal and execute {@code studio.sh}. 164 <p>You may want to add {@code android-studio/bin/} to your PATH environmental 165 variable so that you can start Android Studio from any directory.</p> 166 </li> 167 </ol> 168 169</div><!-- end linux --> 170</div><!-- end procedure box --> 171 172<p>Android Studio is now ready and loaded with the Android developer tools, but there are still a 173couple packages you should add to make your Android SDK complete.</p> 174 175<p class="paging-links"> 176<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> 177Continue: Adding SDK Packages</a></p> 178 179 180</div> 181<!-- ################ END STUDIO ##################### --> 182 183 184 185 186 187 188 189 190 191<!-- ################ JUST SDK TOOLS ##################### --> 192<div id="tools" heading="Installing the Stand-alone SDK Tools" style="display:none"> 193 194 195<p>The stand-alone SDK Tools package does not include a complete Android development environment. 196It includes only the core SDK tools, which you can access from a command line or with a plugin 197for your favorite IDE (if available).</p> 198 199<p>If you didn't download the SDK tools, go <a href="{@docRoot}sdk/index.html" 200><b>download the SDK now</b></a>, 201or switch to the <a href="{@docRoot}sdk/installing/index.html?pkg=adt">Eclipse ADT 202install</a> or <a href="{@docRoot}sdk/installing/index.html?pkg=studio">Android Studio 203install</a> instructions.</p> 204 205 206<div class="procedure-box"> 207<p id="instructions-toggle" 208style="float:right;font-size:13px"><a href='' onclick='showAll();return false;' 209>[ Show instructions for all platforms ]</a></p> 210 211<div class="win docs" style="display:none"> 212 213<p><b>To get started on Windows:</b></p> 214 215<p>Your download package is an executable file that starts an installer. The installer checks your machine 216 for required tools, such as the proper Java SE Development Kit (JDK) and installs it if necessary. 217 The installer then saves the Android SDK Tools into a default location (or you can specify the location).</p> 218 219<ol> 220<li>Double-click the executable ({@code .exe} file) to start the install.</li> 221<li>Make a note of the name and location in which it saves the SDK on your system—you will need to 222refer to the SDK directory later when using 223the SDK tools from the command line.</li> 224<li>Once the installation completes, the installer starts the Android SDK Manager. 225</li> 226</ol> 227 228</div> 229 230 231 232<div class="mac docs" style="display:none"> 233 234<p><b>To get started on Mac OSX:</b></p> 235 236<p>Unpack the ZIP file you've downloaded. By default, it's unpacked 237into a directory named <code>android-sdk-mac_x86</code>. Move it to an appropriate location on your machine, 238such as a "Development" directory in your home directory.</p> 239 240<p>Make a note of the name and location of the SDK directory on your system—you will need to 241refer to the SDK directory later when using 242the SDK tools from the command line.</p> 243 244</div> 245 246 247 248 249<div class="linux docs" style="display:none"> 250 251<p><b>To get started on Linux:</b></p> 252 253<p>Unpack the {@code .tgz} file you've downloaded. By default, the SDK files are unpacked 254into a directory named <code>android-sdk-linux_x86</code>. Move it to an appropriate location on your machine, 255such as a "Development" directory in your home directory.</p> 256 257<p>Make a note of the name and location of the SDK directory on your system—you will need to 258refer to the SDK directory later when using 259the SDK tools from the command line.</p> 260 261 262<h5 id="Troubleshooting" style="margin-bottom:15px"><a href='' class="expandable" 263 onclick="toggleExpandable(this,'#UbuntuTrouble');return false;" 264 >Troubleshooting Ubuntu</a></h5> 265 266<div id="UbuntuTrouble" style="display:none"> 267<ul> 268 <li>If you need help installing and configuring Java on your 269 development machine, you might find these resources helpful: 270 <ul> 271 <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li> 272 <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li> 273 </ul> 274 </li> 275 <li>Here are the steps to install Java and Eclipse, prior to installing 276 the Android SDK and ADT Plugin. 277 <ol> 278 <li><p>If you are running a 64-bit distribution on your development 279 machine, you need to install additional packages first. For Ubuntu 13.10 (Saucy Salamander) 280 and above, install the <code>libncurses5:i386</code>, <code>libstdc++6:i386</code>, and 281 <code>zlib1g:i386</code> packages using <code>apt-get</code>:</p> 282 <pre class="no-pretty-print">sudo dpkg --add-architecture i386 283sudo apt-get update 284sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386</pre> 285 <p>For earlier versions of Ubuntu, install the <code>ia32-libs</code> package using 286 <code>apt-get</code>:</p> 287 <pre class="no-pretty-print">apt-get install ia32-libs</pre> 288 </li> 289 <li>Next, install Java: <pre class="no-pretty-print">apt-get install sun-java6-jdk</pre></li> 290 <li>The Ubuntu package manager does not currently offer an Eclipse 3.7 291 version for download, so we recommend that you download Eclipse from 292 eclipse.org (<a 293 href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a>). 294 A Java or RCP version of Eclipse is recommended.</li> 295 <li>Follow the steps given in previous sections to install the SDK 296 and the ADT plugin. </li> 297 </ol> 298 </li> 299</ul> 300</div><!-- end ubuntu trouble --> 301 302 303</div><!-- end linux --> 304</div><!-- end procedure box --> 305 306 307<p>The Android SDK tools are now ready to begin developing apps, but there are still a 308couple packages you should add to make your Android SDK complete.</p> 309 310<p class="paging-links"> 311<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> 312Continue: Adding SDK Packages</a></p> 313 314 315</div> 316<!-- ################ END JUST TOOLS ##################### --> 317 318 319 320 321 322<!-- ################ DEFAULT ##################### --> 323 324 325<div id="default" style="display:none"> 326 327<p>If you haven't already, <b><a href="{@docRoot}sdk/index.html">download 328the Android SDK</a></b>. </p> 329 330<p>Then, select which SDK package you want to install:</p> 331 332<div class="cols" style="margin:30px 0 60px"> 333<div class="col-4" style="margin-left:0"> 334<a href="{@docRoot}sdk/installing/index.html?pkg=adt" class="landing-button landing-secondary"> 335Eclipse ADT 336</a> 337</div> 338 339<div class="col-4"> 340<a href="{@docRoot}sdk/installing/index.html?pkg=studio" class="landing-button landing-secondary"> 341Android Studio 342</a> 343</div> 344 345<div class="col-4"> 346<a href="{@docRoot}sdk/installing/index.html?pkg=tools" class="landing-button landing-secondary"> 347Stand-alone SDK Tools 348</a> 349</div> 350</div> 351 352 353</div> 354<!-- ################ END DEFAULT ##################### --> 355 356 357 358 359 360 361<script> 362 363// Show proper instructions based on downloaded SDK package 364var package = getUrlParam("pkg"); 365if (package == "tools") { 366 // Show the SDK Tools (other IDE) instructions 367 $("h1").text($("#tools").attr('heading')); 368 $("#tools").show(); 369} else if (package == "adt") { 370 // Show the ADT instructions 371 $("h1").text($("#adt").attr('heading')); 372 $("#adt").show(); 373} else if (package == "studio") { 374 // Show the Android Studio instructions 375 $("h1").text($("#studio").attr('heading')); 376 $("#studio").show(); 377} else { 378 // Show the default page content so user can select their setup 379 $("#default").show(); 380} 381 382// Show the proper instructions based on machine OS 383var $osDocs; 384if (navigator.appVersion.indexOf("Win")!=-1) { 385 $osDocs = $('.win'); 386} else if (navigator.appVersion.indexOf("Mac")!=-1) { 387 $osDocs = $('.mac'); 388} else if (navigator.appVersion.indexOf("Linux")!=-1) { 389 $osDocs = $('.linux'); 390} 391 392if ($osDocs.length) { 393 // reveal only the docs for this OS 394 $osDocs.show(); 395} else { 396 // not running a compatible OS, so just show all the docs 397 $('.docs').show(); 398} 399 400 401/* Shows all the machine OS instructions */ 402function showAll() { 403 $('.docs').show(); 404 $("#instructions-toggle").hide(); 405} 406 407/* Returns the value for the given URL parameter */ 408function getUrlParam(param) { 409 var url = window.location.search.substring(1); 410 var variables = url.split('&'); 411 for (var i = 0; i < variables.length; i++) { 412 var paramName = variables[i].split('='); 413 if (escape(paramName[0]) == param) { 414 return escape(paramName[1]); 415 } 416 } 417} 418 419/* direct link to ubuntu troubleshooting */ 420if ( document.location.href.indexOf('#UbuntuTrouble') > -1 ) { 421 $(".linux.docs").show(); 422 toggleExpandable(this,'#UbuntuTrouble'); 423} 424</script> 425