blob: dc258db963c1ec25d05a0010561aaa26b4f27375 [file] [log] [blame]
Scott Main47950312014-05-29 17:44:09 -07001page.title=Installing the Android SDK
smain@google.com68e68192014-12-15 10:00:59 -08002excludeFromSuggestions=true
Scott Main50e990c2012-06-21 17:14:39 -07003
smain@google.com0da6b002014-10-31 10:45:23 -07004page.tags=sdk tools
smain@google.com61139c82014-10-20 14:29:22 -07005helpoutsWidget=true
6
Scott Main50e990c2012-06-21 17:14:39 -07007@jd:body
8
Scott Main47950312014-05-29 17:44:09 -07009<style>
smain@google.come77f41a2014-06-20 19:06:06 -070010p.paging-links {
11 margin:0 0 40px;
Scott Main47950312014-05-29 17:44:09 -070012}
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}
smain@google.come77f41a2014-06-20 19:06:06 -070021.landing-button {
22 min-width: 155px;
23 text-align: center;
24}
Scott Main47950312014-05-29 17:44:09 -070025</style>
Scott Main50e990c2012-06-21 17:14:39 -070026
27
Scott Main6453dfb2012-10-23 14:14:18 -070028
Scott Main47950312014-05-29 17:44:09 -070029<!-- ################ STUDIO ##################### -->
30<div id="studio" heading="Installing Android Studio" style="display:none">
31
smain@google.comc4a08822014-12-08 12:28:25 -080032<p>Android Studio provides everything you need to start developing apps for Android, including
33the Android Studio IDE and the Android SDK tools.</p>
Scott Main47950312014-05-29 17:44:09 -070034
smain@google.com29e13c52014-12-05 09:38:14 -080035<p>If you didn't download Android Studio, go <a href="{@docRoot}sdk/index.html"
Scott Main47950312014-05-29 17:44:09 -070036><b>download Android Studio now</b></a>, or switch to the
smain@google.com29e13c52014-12-05 09:38:14 -080037<a href="{@docRoot}sdk/installing/index.html?pkg=tools">stand-alone SDK Tools
Scott Main47950312014-05-29 17:44:09 -070038install</a> instructions.</p>
39
40
41<p>Before you set up Android Studio, be sure you have installed
smain@google.comc4a08822014-12-08 12:28:25 -080042JDK 6 or higher (the JRE alone is not sufficient)&mdash;JDK 7 is required when
43developing for Android 5.0 and higher. To check if you
Scott Main47950312014-05-29 17:44:09 -070044have 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>
smain@google.com59a3dd72014-12-08 00:21:15 -080060 <li>Launch the <code>.exe</code> file you just downloaded.</li>
smain@google.comc4a08822014-12-08 12:28:25 -080061 <li>Follow the setup wizard to install Android Studio and any necessary SDK tools.
Scott Main47950312014-05-29 17:44:09 -070062
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>
Ricardo Cervera4ffffb82014-10-01 18:32:42 -070072
Scott Main47950312014-05-29 17:44:09 -070073 </ol>
74
75
Rich Slogar96b245a2014-10-29 14:54:24 -070076<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\&lt;user&gt;\sdk\</code></p>
Scott Main47950312014-05-29 17:44:09 -070080
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>
smain@google.com59a3dd72014-12-08 00:21:15 -080090 <li>Launch the {@code .dmg} file you just downloaded.</li>
Scott Main47950312014-05-29 17:44:09 -070091 <li>Drag and drop Android Studio into the Applications folder.
smain@google.comc4a08822014-12-08 12:28:25 -080092 <li>Open Android Studio and follow the setup wizard to install any necessary SDK tools.
Scott Main47950312014-05-29 17:44:09 -070093 <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 &amp; 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
smain@google.com59a3dd72014-12-08 00:21:15 -0800102<p>If you need use the Android SDK tools from a command line,
103you can access them at:</p>
104<p><code>/Users/&lt;user>/Library/Android/sdk/</code></p>
Scott Main47950312014-05-29 17:44:09 -0700105
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>
smain@google.com59a3dd72014-12-08 00:21:15 -0800115 <li>Unpack the downloaded ZIP file into an
Rich Slogar96b245a2014-10-29 14:54:24 -0700116 appropriate location for your applications.
Scott Main47950312014-05-29 17:44:09 -0700117 <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>
Rich Slogarbe8e6232015-01-21 10:38:38 -0800122 <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,
Rich Slogar69044ae2015-02-24 16:58:34 -0800125 lib32ncurses5-dev, and lib32stdc++6 packages. These packages are required to support 32-bit apps
Rich Slogarbe8e6232015-01-21 10:38:38 -0800126 on a 64-bit machine. </p>
127 </li>
Scott Main47950312014-05-29 17:44:09 -0700128 </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
134couple 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">
138Continue: 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.
157It includes only the core SDK tools, which you can access from a command line or with a plugin
158for your favorite IDE (if available).</p>
159
smain@google.com29e13c52014-12-05 09:38:14 -0800160<p>If you didn't download the SDK tools, go <a href="{@docRoot}sdk/index.html#Other"
Scott Main47950312014-05-29 17:44:09 -0700161><b>download the SDK now</b></a>,
Joe Fernandez3ec76e02014-12-07 21:48:05 -0800162or switch to the <a href="{@docRoot}sdk/installing/index.html?pkg=studio">Android Studio
Scott Main47950312014-05-29 17:44:09 -0700163install</a> instructions.</p>
164
165
166<div class="procedure-box">
167<p id="instructions-toggle"
168style="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
Scott Main50e990c2012-06-21 17:14:39 -0700175<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.
Rich Slogar96b245a2014-10-29 14:54:24 -0700177 The installer then saves the Android SDK Tools to a specified the location outside of the Android
178 Studio directories.</p>
Scott Main50e990c2012-06-21 17:14:39 -0700179
Scott Main6453dfb2012-10-23 14:14:18 -0700180<ol>
181<li>Double-click the executable ({@code .exe} file) to start the install.</li>
Rich Slogar96b245a2014-10-29 14:54:24 -0700182<li>Make a note of the name and location where you save the SDK on your system&mdash;you will need to
Scott Main47950312014-05-29 17:44:09 -0700183refer to the SDK directory later when using
Scott Main6453dfb2012-10-23 14:14:18 -0700184the SDK tools from the command line.</li>
Scott Main47950312014-05-29 17:44:09 -0700185<li>Once the installation completes, the installer starts the Android SDK Manager.
Scott Main6453dfb2012-10-23 14:14:18 -0700186</li>
187</ol>
Scott Main50e990c2012-06-21 17:14:39 -0700188
189</div>
190
Ricardo Cerverafe8b0ea2014-03-28 10:01:41 -0700191
Scott Main50e990c2012-06-21 17:14:39 -0700192
Scott Main47950312014-05-29 17:44:09 -0700193<div class="mac docs" style="display:none">
Ricardo Cerverafe8b0ea2014-03-28 10:01:41 -0700194
Scott Main47950312014-05-29 17:44:09 -0700195<p><b>To get started on Mac OSX:</b></p>
Scott Main50e990c2012-06-21 17:14:39 -0700196
Scott Main47950312014-05-29 17:44:09 -0700197<p>Unpack the ZIP file you've downloaded. By default, it's unpacked
smain@google.com29e13c52014-12-05 09:38:14 -0800198into a directory named <code>android-sdk-mac_x86</code>. Move it to an appropriate location on your
Rich Slogar96b245a2014-10-29 14:54:24 -0700199machine, such as a "Development" directory in your home directory.</p>
Scott Main50e990c2012-06-21 17:14:39 -0700200
201<p>Make a note of the name and location of the SDK directory on your system&mdash;you will need to
Scott Main47950312014-05-29 17:44:09 -0700202refer to the SDK directory later when using
Scott Main50e990c2012-06-21 17:14:39 -0700203the SDK tools from the command line.</p>
Scott Main50e990c2012-06-21 17:14:39 -0700204
205</div>
206
207
208
209
Scott Main47950312014-05-29 17:44:09 -0700210<div class="linux docs" style="display:none">
Ricardo Cerverafe8b0ea2014-03-28 10:01:41 -0700211
Scott Main47950312014-05-29 17:44:09 -0700212<p><b>To get started on Linux:</b></p>
Scott Main50e990c2012-06-21 17:14:39 -0700213
smain@google.com29e13c52014-12-05 09:38:14 -0800214<p>Unpack the {@code .zip} file you've downloaded. The SDK files are download separately to a
Rich Slogar96b245a2014-10-29 14:54:24 -0700215user-specified directory. </p>
Scott Main50e990c2012-06-21 17:14:39 -0700216
217<p>Make a note of the name and location of the SDK directory on your system&mdash;you will need to
Scott Main47950312014-05-29 17:44:09 -0700218refer to the SDK directory later when using
Scott Main50e990c2012-06-21 17:14:39 -0700219the SDK tools from the command line.</p>
Scott Main50e990c2012-06-21 17:14:39 -0700220
221
Scott Main47950312014-05-29 17:44:09 -0700222<h5 id="Troubleshooting" style="margin-bottom:15px"><a href='' class="expandable"
Ricardo Cervera43c758b2014-10-03 09:44:25 -0700223 onclick="toggleExpandable(this,'#UbuntuTrouble');return false;"
Scott Main6453dfb2012-10-23 14:14:18 -0700224 >Troubleshooting Ubuntu</a></h5>
Scott Main50e990c2012-06-21 17:14:39 -0700225
Ricardo Cervera43c758b2014-10-03 09:44:25 -0700226<div id="UbuntuTrouble" style="display:none">
Scott Main50e990c2012-06-21 17:14:39 -0700227<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>
smain@google.comc4a08822014-12-08 12:28:25 -0800235 <li>Here are the steps to install Java:
Scott Main50e990c2012-06-21 17:14:39 -0700236 <ol>
Ricardo Cerverafe8b0ea2014-03-28 10:01:41 -0700237 <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
242sudo apt-get update
243sudo 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>
Scott Main50e990c2012-06-21 17:14:39 -0700247 </li>
Ricardo Cerverafe8b0ea2014-03-28 10:01:41 -0700248 <li>Next, install Java: <pre class="no-pretty-print">apt-get install sun-java6-jdk</pre></li>
Scott Main50e990c2012-06-21 17:14:39 -0700249 </ol>
250 </li>
251</ul>
Scott Main6453dfb2012-10-23 14:14:18 -0700252</div><!-- end ubuntu trouble -->
253
Scott Main50e990c2012-06-21 17:14:39 -0700254
Scott Main47950312014-05-29 17:44:09 -0700255</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
260couple 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">
264Continue: Adding SDK Packages</a></p>
265
266
267</div>
268<!-- ################ END JUST TOOLS ##################### -->
269
270
271
272
smain@google.com29e13c52014-12-05 09:38:14 -0800273
274
275
276
277
Scott Main47950312014-05-29 17:44:09 -0700278
279<!-- ################ DEFAULT ##################### -->
smain@google.come77f41a2014-06-20 19:06:06 -0700280
Scott Main47950312014-05-29 17:44:09 -0700281
282<div id="default" style="display:none">
283
smain@google.come77f41a2014-06-20 19:06:06 -0700284<p>If you haven't already, <b><a href="{@docRoot}sdk/index.html">download
Joe Fernandez3ec76e02014-12-07 21:48:05 -0800285the Android SDK bundle for Android Studio</a></b> or the
286<a href="{@docRoot}sdk/index.html#Other">stand-alone SDK Tools</a>. </p>
Scott Main47950312014-05-29 17:44:09 -0700287
Joe Fernandez3ec76e02014-12-07 21:48:05 -0800288<p>Then, select which SDK bundle you want to install:</p>
Scott Main47950312014-05-29 17:44:09 -0700289
smain@google.come77f41a2014-06-20 19:06:06 -0700290<div class="cols" style="margin:30px 0 60px">
Scott Main50e990c2012-06-21 17:14:39 -0700291
Scott Main47950312014-05-29 17:44:09 -0700292<div class="col-4">
smain@google.come77f41a2014-06-20 19:06:06 -0700293<a href="{@docRoot}sdk/installing/index.html?pkg=studio" class="landing-button landing-secondary">
294Android Studio
295</a>
Scott Main47950312014-05-29 17:44:09 -0700296</div>
297
298<div class="col-4">
smain@google.come77f41a2014-06-20 19:06:06 -0700299<a href="{@docRoot}sdk/installing/index.html?pkg=tools" class="landing-button landing-secondary">
300Stand-alone SDK Tools
301</a>
Scott Main47950312014-05-29 17:44:09 -0700302</div>
303</div>
304
smain@google.com29e13c52014-12-05 09:38:14 -0800305<p></p>
306
307<div>
308<p></p>
309
310</div>
Scott Main47950312014-05-29 17:44:09 -0700311
312</div>
313<!-- ################ END DEFAULT ##################### -->
314
315
316
317
318
Scott Main50e990c2012-06-21 17:14:39 -0700319
320<script>
Scott Main50e990c2012-06-21 17:14:39 -0700321
Scott Main47950312014-05-29 17:44:09 -0700322// Show proper instructions based on downloaded SDK package
323var package = getUrlParam("pkg");
324if (package == "tools") {
325 // Show the SDK Tools (other IDE) instructions
326 $("h1").text($("#tools").attr('heading'));
327 $("#tools").show();
Scott Main47950312014-05-29 17:44:09 -0700328} 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}
Ricardo Cerverafe8b0ea2014-03-28 10:01:41 -0700336
Scott Main47950312014-05-29 17:44:09 -0700337// Show the proper instructions based on machine OS
338var $osDocs;
339if (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
347if ($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 */
357function showAll() {
358 $('.docs').show();
359 $("#instructions-toggle").hide();
360}
361
362/* Returns the value for the given URL parameter */
363function 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 }
Scott Main50e990c2012-06-21 17:14:39 -0700371 }
Scott Main47950312014-05-29 17:44:09 -0700372}
373
Ricardo Cervera4ffffb82014-10-01 18:32:42 -0700374/* direct link to ubuntu troubleshooting */
Ricardo Cervera43c758b2014-10-03 09:44:25 -0700375if ( document.location.href.indexOf('#UbuntuTrouble') > -1 ) {
Ricardo Cervera4ffffb82014-10-01 18:32:42 -0700376 $(".linux.docs").show();
Ricardo Cervera43c758b2014-10-03 09:44:25 -0700377 toggleExpandable(this,'#UbuntuTrouble');
Ricardo Cervera4ffffb82014-10-01 18:32:42 -0700378}
Scott Main50e990c2012-06-21 17:14:39 -0700379</script>