1 page.title=Installing the Android SDK 2 excludeFromSuggestions=true 3 4 page.tags=sdk tools 5 helpoutsWidget=true 6 7 @jd:body 8 9 <style> 10 p.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 33 the 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 38 install</a> instructions.</p> 39 40 41 <p>Before you set up Android Studio, be sure you have installed 42 JDK 6 or higher (the JRE alone is not sufficient)—JDK 7 is required when 43 developing for Android 5.0 and higher. To check if you 44 have JDK installed (and which version), open a terminal and type <code>javac -version</code>. 45 If 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" 53 style="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 77 directory. If you need to access the tools directly, use a terminal to navigate to the location 78 where 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, 103 you 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>If the SDK is not already installed, follow the setup wizard to install the SDK and any 123 necessary SDK tools. 124 <p class="note"><strong>Note:</strong> You may also need to install the ia32-libs, 125 lib32ncurses5-dev, and lib32stdc++6 packages. These packages are required to support 32-bit apps 126 on a 64-bit machine. </p> 127 </li> 128 </ol> 129 130 </div><!-- end linux --> 131 </div><!-- end procedure box --> 132 133 <p>Android Studio is now ready and loaded with the Android developer tools, but there are still a 134 couple packages you should add to make your Android SDK complete.</p> 135 136 <p class="paging-links"> 137 <a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> 138 Continue: Adding SDK Packages</a></p> 139 140 141 </div> 142 <!-- ################ END STUDIO ##################### --> 143 144 145 146 147 148 149 150 151 152 <!-- ################ JUST SDK TOOLS ##################### --> 153 <div id="tools" heading="Installing the Stand-alone SDK Tools" style="display:none"> 154 155 156 <p>The stand-alone SDK Tools package does not include a complete Android development environment. 157 It includes only the core SDK tools, which you can access from a command line or with a plugin 158 for your favorite IDE (if available).</p> 159 160 <p>If you didn't download the SDK tools, go <a href="{@docRoot}sdk/index.html#Other" 161 ><b>download the SDK now</b></a>, 162 or switch to the <a href="{@docRoot}sdk/installing/index.html?pkg=studio">Android Studio 163 install</a> instructions.</p> 164 165 166 <div class="procedure-box"> 167 <p id="instructions-toggle" 168 style="float:right;font-size:13px"><a href='' onclick='showAll();return false;' 169 >[ Show instructions for all platforms ]</a></p> 170 171 <div class="win docs" style="display:none"> 172 173 <p><b>To get started on Windows:</b></p> 174 175 <p>Your download package is an executable file that starts an installer. The installer checks your machine 176 for required tools, such as the proper Java SE Development Kit (JDK) and installs it if necessary. 177 The installer then saves the Android SDK Tools to a specified the location outside of the Android 178 Studio directories.</p> 179 180 <ol> 181 <li>Double-click the executable ({@code .exe} file) to start the install.</li> 182 <li>Make a note of the name and location where you save the SDK on your system—you will need to 183 refer to the SDK directory later when using 184 the SDK tools from the command line.</li> 185 <li>Once the installation completes, the installer starts the Android SDK Manager. 186 </li> 187 </ol> 188 189 </div> 190 191 192 193 <div class="mac docs" style="display:none"> 194 195 <p><b>To get started on Mac OSX:</b></p> 196 197 <p>Unpack the ZIP file you've downloaded. By default, it's unpacked 198 into a directory named <code>android-sdk-mac_x86</code>. Move it to an appropriate location on your 199 machine, such as a "Development" directory in your home directory.</p> 200 201 <p>Make a note of the name and location of the SDK directory on your system—you will need to 202 refer to the SDK directory later when using 203 the SDK tools from the command line.</p> 204 205 </div> 206 207 208 209 210 <div class="linux docs" style="display:none"> 211 212 <p><b>To get started on Linux:</b></p> 213 214 <p>Unpack the {@code .zip} file you've downloaded. The SDK files are download separately to a 215 user-specified directory. </p> 216 217 <p>Make a note of the name and location of the SDK directory on your system—you will need to 218 refer to the SDK directory later when using 219 the SDK tools from the command line.</p> 220 221 222 <h5 id="Troubleshooting" style="margin-bottom:15px"><a href='' class="expandable" 223 onclick="toggleExpandable(this,'#UbuntuTrouble');return false;" 224 >Troubleshooting Ubuntu</a></h5> 225 226 <div id="UbuntuTrouble" style="display:none"> 227 <ul> 228 <li>If you need help installing and configuring Java on your 229 development machine, you might find these resources helpful: 230 <ul> 231 <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li> 232 <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li> 233 </ul> 234 </li> 235 <li>Here are the steps to install Java: 236 <ol> 237 <li><p>If you are running a 64-bit distribution on your development 238 machine, you need to install additional packages first. For Ubuntu 13.10 (Saucy Salamander) 239 and above, install the <code>libncurses5:i386</code>, <code>libstdc++6:i386</code>, and 240 <code>zlib1g:i386</code> packages using <code>apt-get</code>:</p> 241 <pre class="no-pretty-print">sudo dpkg --add-architecture i386 242 sudo apt-get update 243 sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386</pre> 244 <p>For earlier versions of Ubuntu, install the <code>ia32-libs</code> package using 245 <code>apt-get</code>:</p> 246 <pre class="no-pretty-print">apt-get install ia32-libs</pre> 247 </li> 248 <li>Next, install Java: <pre class="no-pretty-print">apt-get install sun-java6-jdk</pre></li> 249 </ol> 250 </li> 251 </ul> 252 </div><!-- end ubuntu trouble --> 253 254 255 </div><!-- end linux --> 256 </div><!-- end procedure box --> 257 258 259 <p>The Android SDK tools are now ready to begin developing apps, but there are still a 260 couple packages you should add to make your Android SDK complete.</p> 261 262 <p class="paging-links"> 263 <a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link"> 264 Continue: Adding SDK Packages</a></p> 265 266 267 </div> 268 <!-- ################ END JUST TOOLS ##################### --> 269 270 271 272 273 274 275 276 277 278 279 <!-- ################ DEFAULT ##################### --> 280 281 282 <div id="default" style="display:none"> 283 284 <p>If you haven't already, <b><a href="{@docRoot}sdk/index.html">download 285 the Android SDK bundle for Android Studio</a></b> or the 286 <a href="{@docRoot}sdk/index.html#Other">stand-alone SDK Tools</a>. </p> 287 288 <p>Then, select which SDK bundle you want to install:</p> 289 290 <div class="cols" style="margin:30px 0 60px"> 291 292 <div class="col-4"> 293 <a href="{@docRoot}sdk/installing/index.html?pkg=studio" class="landing-button landing-secondary"> 294 Android Studio 295 </a> 296 </div> 297 298 <div class="col-4"> 299 <a href="{@docRoot}sdk/installing/index.html?pkg=tools" class="landing-button landing-secondary"> 300 Stand-alone SDK Tools 301 </a> 302 </div> 303 </div> 304 305 <p></p> 306 307 <div> 308 <p></p> 309 310 </div> 311 312 </div> 313 <!-- ################ END DEFAULT ##################### --> 314 315 316 317 318 319 320 <script> 321 322 // Show proper instructions based on downloaded SDK package 323 var package = getUrlParam("pkg"); 324 if (package == "tools") { 325 // Show the SDK Tools (other IDE) instructions 326 $("h1").text($("#tools").attr('heading')); 327 $("#tools").show(); 328 } else if (package == "studio") { 329 // Show the Android Studio instructions 330 $("h1").text($("#studio").attr('heading')); 331 $("#studio").show(); 332 } else { 333 // Show the default page content so user can select their setup 334 $("#default").show(); 335 } 336 337 // Show the proper instructions based on machine OS 338 var $osDocs; 339 if (navigator.appVersion.indexOf("Win")!=-1) { 340 $osDocs = $('.win'); 341 } else if (navigator.appVersion.indexOf("Mac")!=-1) { 342 $osDocs = $('.mac'); 343 } else if (navigator.appVersion.indexOf("Linux")!=-1) { 344 $osDocs = $('.linux'); 345 } 346 347 if ($osDocs.length) { 348 // reveal only the docs for this OS 349 $osDocs.show(); 350 } else { 351 // not running a compatible OS, so just show all the docs 352 $('.docs').show(); 353 } 354 355 356 /* Shows all the machine OS instructions */ 357 function showAll() { 358 $('.docs').show(); 359 $("#instructions-toggle").hide(); 360 } 361 362 /* Returns the value for the given URL parameter */ 363 function getUrlParam(param) { 364 var url = window.location.search.substring(1); 365 var variables = url.split('&'); 366 for (var i = 0; i < variables.length; i++) { 367 var paramName = variables[i].split('='); 368 if (escape(paramName[0]) == param) { 369 return escape(paramName[1]); 370 } 371 } 372 } 373 374 /* direct link to ubuntu troubleshooting */ 375 if ( document.location.href.indexOf('#UbuntuTrouble') > -1 ) { 376 $(".linux.docs").show(); 377 toggleExpandable(this,'#UbuntuTrouble'); 378 } 379 </script> 380