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