Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 1 | page.title=Set Up the SDK |
Dirk Dougherty | 7470945 | 2015-05-15 00:51:24 -0700 | [diff] [blame] | 2 | page.image=images/cards/card-set-up_16-9_2x.png |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 3 | |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 4 | @jd:body |
| 5 | |
| 6 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 7 | <div id="qv-wrapper"> |
| 8 | <div id="qv"> |
| 9 | <h2>In this document</h2> |
| 10 | <ol> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 11 | <li><a href="#get-as13">Get Android Studio 1.3</a></li> |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 12 | <li><a href="#get-sdk">Get the Android 6.0 SDK</a></li> |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 13 | <li><a href="#create-update">Create or Update a Project</a></li> |
| 14 | <li><a href="#setup-test">Set Up for Testing</a></li> |
| 15 | </ol> |
| 16 | </div> |
| 17 | </div> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 18 | |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 19 | <p>With Developer Preview 3, the <strong>official Android 6.0 SDK is now available</strong> from the Android SDK |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 20 | Manager. This document assumes that you are familiar with Android app development, such |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 21 | as using the Android SDK Manager and creating projects. If you are new to |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 22 | Android, see <a href="{@docRoot}training/basics/firstapp/index.html">Building Your First |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 23 | App</a> training lesson first.</p> |
| 24 | |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 25 | |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 26 | <h2 id="get-as13">Get Android Studio 1.3</h2> |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 27 | |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 28 | <p> |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 29 | It is highly recommended that you install the Android Studio 1.3 to work best with |
| 30 | the Android 6.0 SDK. Please update your Android Studio installation to version 1.3 or |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 31 | higher, or follow the instructions for |
| 32 | <a href="{@docRoot}sdk/installing/index.html?pkg=studio">Installing Android Studio</a>. |
| 33 | </p> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 34 | |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 35 | |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 36 | <h2 id="get-sdk">Get the Android 6.0 SDK</h2> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 37 | |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 38 | <p>To add the Android 6.0 SDK components to your development environment:</p> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 39 | |
| 40 | <ol> |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 41 | <li>Launch Android Studio 1.3 or higher. |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 42 | </li> |
| 43 | |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 44 | <li>Open the <strong>Settings</strong> window (on Windows, you can do this |
| 45 | by choosing <strong>File > Settings</strong>). Choose the |
| 46 | <strong>Appearance & Behavior > System |
| 47 | Settings > Updates</strong> panel. |
| 48 | |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 49 | <p class="aside">On Mac OS X, you can find the <strong>Appearance & |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 50 | Behavior</strong> panel |
| 51 | in Android Studio's <strong>Preferences</strong> window.</p> |
| 52 | </li> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 53 | |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 54 | <li>On the <strong>Updates</strong> panel, choose the option for |
Andrew Solovay | 7d36a25 | 2015-05-28 18:33:29 -0700 | [diff] [blame] | 55 | <strong>Automatically check updates for Android SDK: Preview Channel</strong>. |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 56 | </li> |
| 57 | |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 58 | <li>Launch the <strong>Android SDK Manager</strong>. (With Android Studio 1.3, |
| 59 | the SDK Manager is integrated into Android Studio instead of being a |
| 60 | standalone application.) |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 61 | </li> |
| 62 | |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 63 | <li>Under the <strong>Platforms</strong> section, select <strong>Android 6.0</strong>. |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 64 | </li> |
| 65 | |
| 66 | <li>In the <strong>Tools</strong> section, select the latest Android <strong> |
| 67 | SDK Tools</strong>, <strong>Platform-tools</strong>, and |
| 68 | <strong>Build-tools</strong>. |
| 69 | </li> |
| 70 | |
| 71 | <li>Click <strong>Install packages</strong> and accept the licensing |
| 72 | agreement for all of the packages. |
| 73 | </li> |
| 74 | |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 75 | <li>Verify that the Android 6.0 SDK is installed by opening the <strong> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 76 | Settings</strong> window and choosing the <strong>Appearance & Behavior |
| 77 | > System Settings > Android SDK</strong> panel.</li> |
| 78 | |
| 79 | <li>On the <strong>Android SDK</strong> panel, choose |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 80 | the <strong>SDK Platforms</strong> tab. <strong>Android 6.0</strong> should be listed as <em>Installed</em>. Also, open the |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 81 | <strong>SDK Tools</strong> tab to verify that the latest tools are |
| 82 | installed. |
| 83 | </li> |
| 84 | </ol> |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 85 | <p>After completing these steps, the preview components are available in your development |
| 86 | environment. </p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 87 | |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 88 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 89 | <h2 id="create-update">Create or Update a Project</h2> |
| 90 | |
| 91 | <p> |
| 92 | In order to use the preview APIs, you must create or update a development project to use |
| 93 | the preview components. |
| 94 | </p> |
| 95 | |
| 96 | |
| 97 | <h3 id="create">Create a new project</h3> |
| 98 | |
| 99 | <p> |
David Friedman | 3519664 | 2015-05-27 23:09:20 -0700 | [diff] [blame] | 100 | We recommend using Android Studio to create a project with the preview. Follow the steps |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 101 | described in <a href="{@docRoot}sdk/installing/create-project.html">Creating a Project</a> |
| 102 | until you arrive at the <em>Form Factors</em> screen in the project wizard. Then perform |
| 103 | the following steps to create a project configured for the preview. |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 104 | </p> |
| 105 | |
| 106 | <ul> |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 107 | <li>Check <strong>Phone and Tablet</strong>.</li> |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 108 | <li>Select <strong>API 23: Android 6.0 (Marshmallow)</strong> in <strong>Minimum |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 109 | SDK</strong>.</li> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 110 | </ul> |
| 111 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 112 | |
| 113 | <h3 id="update">Update an existing project</h3> |
| 114 | |
| 115 | <p> |
Dirk Dougherty | bd58d6f | 2015-08-17 06:50:29 -0700 | [diff] [blame] | 116 | For existing projects, if you are using Android 6.0 APIs (API level 23) you must |
| 117 | modify the project configuration. In your development environment, open the |
| 118 | <code>build.gradle</code> file for your module and |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 119 | set these values as follows: |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 120 | </p> |
| 121 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 122 | <ul> |
Joe Fernandez | bd4ed32 | 2015-08-16 16:56:02 -0700 | [diff] [blame] | 123 | <li><code>compileSdkVersion</code> is set to <code>'23'</code></li> |
| 124 | <li><code>targetSdkVersion</code> is set to <code>'23'</code></li> |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 125 | </ul> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 126 | |
| 127 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 128 | <h2 id="setup-test">Set Up for Testing</h2> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 129 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 130 | <p> |
David Friedman | a728e50 | 2015-05-27 23:30:50 -0700 | [diff] [blame] | 131 | Testing an app with the preview requires that you have a device or virtual device configured with |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 132 | the preview version of the platform. If you have a compatible device, you can install the preview |
| 133 | platform for testing. Otherwise, you can configure a virtual device for testing. |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 134 | </p> |
| 135 | |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 136 | <h3 id="setup-device">Set up a physical device</h3> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 137 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 138 | <p> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 139 | If you have a Nexus 5, Nexus 6, Nexus 9, or Android TV, you can install a preview |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 140 | system image on these devices for testing your app. |
David Friedman | a728e50 | 2015-05-27 23:30:50 -0700 | [diff] [blame] | 141 | You can set up a virtual device with the preview version of the platform from within Android Studio |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 142 | using the Android Virtual Device Manager tool. |
| 143 | </p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 144 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 145 | <p class="caution"> |
| 146 | <strong>Important:</strong> Installing a preview image on a device <em>removes all data from |
| 147 | it</em>, so you should backup any data before installing a preview image. |
| 148 | </p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 149 | |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 150 | <h3 id="setupAVD">Set up a virtual device</h3> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 151 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 152 | <p> |
| 153 | You can set up virtual device with the preview version of the platform from within Android Studio |
| 154 | using the Android Virtual Device Manager tool. |
| 155 | </p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 156 | |
| 157 | <p>To create an AVD with the AVD Manager:</p> |
| 158 | |
| 159 | <ol> |
Andrew Solovay | a024a6d | 2015-05-27 11:07:35 -0700 | [diff] [blame] | 160 | <li>Install the Preview SDK in your development environment, as described |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 161 | in <a href="{@docRoot}preview/setup-sdk.html">Setting Up the Preview |
| 162 | SDK.</a></li> |
| 163 | <li>Follow the steps in |
| 164 | <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD |
| 165 | Manager</a>. Use the following settings: |
| 166 | <ul> |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 167 | <li><strong>Device:</strong> Nexus 5, Nexus 6, Nexus 9, or Android TV</li> |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 168 | <li><strong>Target:</strong> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 169 | Android M (Preview) - API Level M</li> |
Andrew Solovay | 525a085 | 2015-05-28 10:56:57 -0700 | [diff] [blame] | 170 | <li><strong>ABI:</strong> x86</li> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 171 | </ul> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 172 | </li> |
| 173 | </ol> |
| 174 | |
Joe Fernandez | 23fcc39 | 2015-05-19 12:27:07 -0700 | [diff] [blame] | 175 | <p> |
| 176 | For more information about creating virtual devices for testing, see <a href= |
| 177 | "{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>. |
| 178 | </p> |