summaryrefslogtreecommitdiffstats
path: root/docs/html/sdk/installing/index.jd
blob: dc258db963c1ec25d05a0010561aaa26b4f27375 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
page.title=Installing the Android SDK
excludeFromSuggestions=true

page.tags=sdk tools
helpoutsWidget=true

@jd:body

<style>
p.paging-links {
  margin:0 0 40px;
}
.paging-links .next-page-link {
  right:initial;
}
.procedure-box {
  padding:20px 20px 5px;
  margin-bottom:1em;
  background:#eee;
}
.landing-button {
  min-width: 155px;
  text-align: center;
}
</style>



<!-- ################    STUDIO    ##################### -->
<div id="studio" heading="Installing Android Studio" style="display:none">

<p>Android Studio provides everything you need to start developing apps for Android, including
the Android Studio IDE and the Android SDK tools.</p>

<p>If you didn't download Android Studio, go <a href="{@docRoot}sdk/index.html"
><b>download Android Studio now</b></a>, or switch to the
<a href="{@docRoot}sdk/installing/index.html?pkg=tools">stand-alone SDK Tools
install</a> instructions.</p>


<p>Before you set up Android Studio, be sure you have installed
JDK 6 or higher (the JRE alone is not sufficient)&mdash;JDK 7 is required when
developing for Android 5.0 and higher. To check if you
have JDK installed (and which version), open a terminal and type <code>javac -version</code>.
If the JDK is not available or the version is lower than 6,
<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" class="external-link"
>go download JDK</a>.</p>


<div class="procedure-box">

<p id="instructions-toggle"
style="float:right;font-size:13px"><a href='' onclick='showAll();return false;'
>[ Show instructions for all platforms ]</a></p>

<div class="win docs" style="display:none">

<p><b>To set up Android Studio on Windows:</b></p>
  <ol>
    <li>Launch the <code>.exe</code> file you just downloaded.</li>
    <li>Follow the setup wizard to install Android Studio and any necessary SDK tools.

    <p>On some Windows systems, the launcher script does not find where Java is installed.
      If you encounter this problem,
      you need to set an environment variable indicating the correct location.</p>
      <p>Select <strong>Start menu > Computer > System Properties >
      Advanced System Properties</strong>. Then open <strong>Advanced tab > Environment
      Variables</strong> and add a new system variable <code>JAVA_HOME</code> that points to
      your JDK folder, for example <code>C:\Program Files\Java\jdk1.7.0_21</code>.</p>
    </p>
    </li>

  </ol>


<p>The individual tools and other SDK packages are saved outside the Android Studio application
directory. If you need to access the tools directly, use a terminal to navigate to the location
where they are installed. For example:</p>
<p><code>\Users\&lt;user&gt;\sdk\</code></p>



</div><!-- end windows -->


<div class="mac docs" style="display:none">

<p><b>To set up Android Studio on Mac OSX:</b></p>
  <ol>
    <li>Launch the {@code .dmg} file you just downloaded.</li>
    <li>Drag and drop Android Studio into the Applications folder.
    <li>Open Android Studio and follow the setup wizard to install any necessary SDK tools.
      <p>
      Depending on your security settings, when you attempt to open Android Studio, you might
      see a warning that says the package is damaged and should be moved to the trash. If this
      happens, go to <strong>System Preferences > Security &amp; Privacy</strong> and under
      <strong>Allow applications downloaded from</strong>, select <strong>Anywhere</strong>.
      Then open Android Studio again.</p>
    </li>
  </ol>

<p>If you need use the Android SDK tools from a command line,
you can access them at:</p>
<p><code>/Users/&lt;user>/Library/Android/sdk/</code></p>


</div><!-- end mac -->


<div class="linux docs" style="display:none">

<p><b>To set up Android Studio on Linux:</b></p>

  <ol>
    <li>Unpack the downloaded ZIP file into an
        appropriate location for your applications.
    <li>To launch Android Studio, navigate to the {@code android-studio/bin/} directory
    in a terminal and execute {@code studio.sh}.
      <p>You may want to add {@code android-studio/bin/} to your PATH environmental
      variable so that you can start Android Studio from any directory.</p>
    </li>
    <li>If the SDK is not already installed, follow the setup wizard to install the SDK and any
    necessary SDK tools.
    <p class="note"><strong>Note:</strong> You may also need to install the ia32-libs,
    lib32ncurses5-dev, and lib32stdc++6 packages. These packages are required to support 32-bit apps
    on a 64-bit machine. </p>
    </li>
  </ol>

</div><!-- end linux -->
</div><!-- end procedure box -->

<p>Android Studio is now ready and loaded with the Android developer tools, but there are still a
couple packages you should add to make your Android SDK complete.</p>

<p class="paging-links">
<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link">
Continue: Adding SDK Packages</a></p>


</div>
<!-- ################    END STUDIO    ##################### -->









<!-- ################    JUST SDK TOOLS    ##################### -->
<div id="tools" heading="Installing the Stand-alone SDK Tools" style="display:none">


<p>The stand-alone SDK Tools package does not include a complete Android development environment.
It includes only the core SDK tools, which you can access from a command line or with a plugin
for your favorite IDE (if available).</p>

<p>If you didn't download the SDK tools, go <a href="{@docRoot}sdk/index.html#Other"
><b>download the SDK now</b></a>,
or switch to the <a href="{@docRoot}sdk/installing/index.html?pkg=studio">Android Studio
install</a> instructions.</p>


<div class="procedure-box">
<p id="instructions-toggle"
style="float:right;font-size:13px"><a href='' onclick='showAll();return false;'
>[ Show instructions for all platforms ]</a></p>

<div class="win docs" style="display:none">

<p><b>To get started on Windows:</b></p>

<p>Your download package is an executable file that starts an installer. The installer checks your machine
  for required tools, such as the proper Java SE Development Kit (JDK) and installs it if necessary.
  The installer then saves the Android SDK Tools to a specified the location outside of the Android
  Studio directories.</p>

<ol>
<li>Double-click the executable ({@code .exe} file) to start the install.</li>
<li>Make a note of the name and location where you save the SDK on your system&mdash;you will need to
refer to the SDK directory later when using
the SDK tools from the command line.</li>
<li>Once the installation completes, the installer starts the Android SDK Manager.
</li>
</ol>

</div>



<div class="mac docs" style="display:none">

<p><b>To get started on Mac OSX:</b></p>

<p>Unpack the ZIP file you've downloaded. By default, it's unpacked
into a directory named <code>android-sdk-mac_x86</code>. Move it to an appropriate location on your
machine, such as a "Development" directory in your home directory.</p>

<p>Make a note of the name and location of the SDK directory on your system&mdash;you will need to
refer to the SDK directory later when using
the SDK tools from the command line.</p>

</div>




<div class="linux docs" style="display:none">

<p><b>To get started on Linux:</b></p>

<p>Unpack the {@code .zip} file you've downloaded. The SDK files are download separately to a
user-specified directory. </p>

<p>Make a note of the name and location of the SDK directory on your system&mdash;you will need to
refer to the SDK directory later when using
the SDK tools from the command line.</p>


<h5 id="Troubleshooting" style="margin-bottom:15px"><a href='' class="expandable"
  onclick="toggleExpandable(this,'#UbuntuTrouble');return false;"
  >Troubleshooting Ubuntu</a></h5>

<div id="UbuntuTrouble" style="display:none">
<ul>
  <li>If you need help installing and configuring Java on your
    development machine, you might find these resources helpful:
    <ul>
      <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li>
      <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li>
    </ul>
  </li>
  <li>Here are the steps to install Java:
    <ol>
      <li><p>If you are running a 64-bit distribution on your development
      machine, you need to install additional packages first. For Ubuntu 13.10 (Saucy Salamander)
      and above, install the <code>libncurses5:i386</code>, <code>libstdc++6:i386</code>, and
      <code>zlib1g:i386</code> packages using <code>apt-get</code>:</p>
      <pre class="no-pretty-print">sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386</pre>
      <p>For earlier versions of Ubuntu, install the <code>ia32-libs</code> package using
      <code>apt-get</code>:</p>
      <pre class="no-pretty-print">apt-get install ia32-libs</pre>
      </li>
      <li>Next, install Java: <pre class="no-pretty-print">apt-get install sun-java6-jdk</pre></li>
    </ol>
  </li>
</ul>
</div><!-- end ubuntu trouble -->


</div><!-- end linux -->
</div><!-- end procedure box -->


<p>The Android SDK tools are now ready to begin developing apps, but there are still a
couple packages you should add to make your Android SDK complete.</p>

<p class="paging-links">
<a href="{@docRoot}sdk/installing/adding-packages.html" class="next-page-link">
Continue: Adding SDK Packages</a></p>


</div>
<!-- ################    END JUST TOOLS    ##################### -->










<!-- ################    DEFAULT    ##################### -->


<div id="default" style="display:none">

<p>If you haven't already, <b><a href="{@docRoot}sdk/index.html">download
the Android SDK bundle for Android Studio</a></b> or the
<a href="{@docRoot}sdk/index.html#Other">stand-alone SDK Tools</a>. </p>

<p>Then, select which SDK bundle you want to install:</p>

<div class="cols" style="margin:30px 0 60px">

<div class="col-4">
<a href="{@docRoot}sdk/installing/index.html?pkg=studio" class="landing-button landing-secondary">
Android Studio
</a>
</div>

<div class="col-4">
<a href="{@docRoot}sdk/installing/index.html?pkg=tools" class="landing-button landing-secondary">
Stand-alone SDK Tools
</a>
</div>
</div>

<p></p>

<div>
<p></p>

</div>

</div>
<!-- ################    END DEFAULT    ##################### -->






<script>

// Show proper instructions based on downloaded SDK package
var package = getUrlParam("pkg");
if (package == "tools") {
  // Show the SDK Tools (other IDE) instructions
  $("h1").text($("#tools").attr('heading'));
  $("#tools").show();
} else if (package == "studio") {
  // Show the Android Studio instructions
  $("h1").text($("#studio").attr('heading'));
  $("#studio").show();
} else {
  // Show the default page content so user can select their setup
  $("#default").show();
}

// Show the proper instructions based on machine OS
var $osDocs;
if (navigator.appVersion.indexOf("Win")!=-1) {
  $osDocs = $('.win');
} else if (navigator.appVersion.indexOf("Mac")!=-1) {
  $osDocs = $('.mac');
} else if (navigator.appVersion.indexOf("Linux")!=-1) {
  $osDocs = $('.linux');
}

if ($osDocs.length) {
  // reveal only the docs for this OS
  $osDocs.show();
} else {
  // not running a compatible OS, so just show all the docs
  $('.docs').show();
}


/* Shows all the machine OS instructions */
function showAll() {
  $('.docs').show();
  $("#instructions-toggle").hide();
}

/* Returns the value for the given URL parameter */
function getUrlParam(param) {
  var url = window.location.search.substring(1);
  var variables = url.split('&');
  for (var i = 0; i < variables.length; i++) {
    var paramName = variables[i].split('=');
    if (escape(paramName[0]) == param) {
      return escape(paramName[1]);
    }
  }
}

/* direct link to ubuntu troubleshooting */
if ( document.location.href.indexOf('#UbuntuTrouble') > -1 ) {
  $(".linux.docs").show();
  toggleExpandable(this,'#UbuntuTrouble');
}
</script>