Robert Ly | 35f2fda | 2013-01-29 16:27:05 -0800 | [diff] [blame] | 1 | page.title=Building for devices |
| 2 | @jd:body |
| 3 | |
| 4 | <!-- |
| 5 | Copyright 2010 The Android Open Source Project |
| 6 | |
| 7 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | you may not use this file except in compliance with the License. |
| 9 | You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | --> |
| 19 | <div id="qv-wrapper"> |
| 20 | <div id="qv"> |
| 21 | <h2>In this document</h2> |
| 22 | <ol id="auto-toc"> |
| 23 | </ol> |
| 24 | </div> |
| 25 | </div> |
| 26 | |
| 27 | <p>This page complements the main page about |
| 28 | <a href="building-running.html">Building and Running</a> with |
| 29 | information that is specific to individual devices.</p> |
| 30 | <p>With the current release, it is possible to build for |
| 31 | Nexus 10, for Nexus 7 (Wi-Fi), and for some variants of Galaxy Nexus. |
| 32 | The exact level of functionality for each device depends on the availability |
| 33 | of the relevant proprietary hardware-specific binaries.</p> |
| 34 | <p>All configurations of Nexus 10 can be used. On those devices, graphics, audio, |
| 35 | Wi-Fi, Bluetooth, camera, NFC, GPS and orientation sensors are functional.</p> |
| 36 | <p>Nexus 4 cannot be used at the moment.</p> |
| 37 | <p>The Wi-Fi variants of Nexus 7 can be used. On Nexus 7, graphics and audio are |
| 38 | functional, as well as Wi-Fi and Bluetooth. Due to hardware differences, do |
| 39 | not use 4.1.1 on a Nexus 7 that was originally sold with 4.1.2 or newer. |
| 40 | The Mobile variant is not supported.</p> |
| 41 | <p>The variants of Galaxy Nexus that can be used are the GSM/HSPA+ configuration |
| 42 | "maguro" (only if it was originally sold with a "yakju" or "takju" operating |
| 43 | system) and the VZW CDMA/LTE configuration "toro". On those devices, graphics |
| 44 | and audio are functional, as well as Wi-Fi, Bluetooth, and access to the |
| 45 | respective cellular networks. NFC and the orientation sensors are functional.</p> |
| 46 | <p>The Sprint CDMA/LTE configuration "toroplus" of Galaxy Nexus is supported |
| 47 | experimentally. On that configuration, the cellular network is not functional, |
| 48 | and the other peripherals work like they do on "toro".</p> |
| 49 | <p>The Motorola Xoom can be used in the Wi-Fi configuration "wingray" |
| 50 | sold in the USA, with Android 4.1.2. Graphics and audio are functional |
| 51 | as well as Wi-Fi and Bluetooth and the orientation sensors.</p> |
| 52 | <p>All configurations of Nexus S and Nexus S 4G can be used with Android 4.1.2. |
| 53 | On those devices all the peripherals are functional: graphics, audio, Wi-Fi, |
| 54 | Bluetooth, cell networks, sensors, camera, hardware codecs, NFC, GPS.</p> |
| 55 | <p>In addition, <a href="http://pandaboard.org">PandaBoard</a> a.k.a. "panda" can be used |
| 56 | in the master branch, but is considered experimental. |
| 57 | The specific details to use a PandaBoard with the Android Open-Source Project |
| 58 | are in the file <code>device/ti/panda/README</code> in the source tree.</p> |
| 59 | <p>Nexus One a.k.a. "passion" is obsolete, was experimental in gingerbread, |
| 60 | and can't be used with newer versions of the Android Open-Source |
| 61 | Project.</p> |
| 62 | <p>Android Developer Phones (ADP1 and ADP2, a.k.a. "dream" and "sapphire") are |
| 63 | obsolete, were experimental in froyo, and can't be used with |
| 64 | newer versions of the Android Open-Source Project.</p> |
| 65 | <h2 id="building-fastboot-and-adb">Building fastboot and adb</h2> |
| 66 | <p>If you don't already have those tools, fastboot and adb can be built with |
| 67 | the regular build system. Follow the instructions on the page about |
| 68 | <a href="building-running.html">Building and Running</a>, and replace the main <code>make</code> command with</p> |
| 69 | <pre><code>$ make fastboot adb |
| 70 | </code></pre> |
| 71 | <h2 id="booting-into-fastboot-mode">Booting into fastboot mode</h2> |
| 72 | <p>During a cold boot, the following key combinations can be used to boot into fastboot mode, |
| 73 | which is a mode in the bootloader that can be used to flash the devices:</p> |
| 74 | <table> |
| 75 | <thead> |
| 76 | <tr> |
| 77 | <th>Device</th> |
| 78 | <th>Keys</th> |
| 79 | </tr> |
| 80 | </thead> |
| 81 | <tbody> |
| 82 | <tr> |
| 83 | <td>manta</td> |
| 84 | <td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td> |
| 85 | </tr> |
| 86 | <tr> |
| 87 | <td>mako</td> |
| 88 | <td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td> |
| 89 | </tr> |
| 90 | <tr> |
| 91 | <td>grouper</td> |
| 92 | <td>Press <em>Power</em> for a second, and press <em>Volume Down</em> when the bootloader logo appears</td> |
| 93 | </tr> |
| 94 | <tr> |
| 95 | <td>tilapia</td> |
| 96 | <td>Press <em>Power</em> for a second, and press <em>Volume Down</em> when the bootloader logo appears</td> |
| 97 | </tr> |
| 98 | <tr> |
| 99 | <td>phantasm</td> |
| 100 | <td>Power the device, cover it with one hand after the LEDs light up and until they turn red</td> |
| 101 | </tr> |
| 102 | <tr> |
| 103 | <td>maguro</td> |
| 104 | <td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td> |
| 105 | </tr> |
| 106 | <tr> |
| 107 | <td>toro</td> |
| 108 | <td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td> |
| 109 | </tr> |
| 110 | <tr> |
| 111 | <td>toroplus</td> |
| 112 | <td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td> |
| 113 | </tr> |
| 114 | <tr> |
| 115 | <td>panda</td> |
| 116 | <td>Press and hold <em>Input</em>, then press <em>Power</em></td> |
| 117 | </tr> |
| 118 | <tr> |
| 119 | <td>wingray</td> |
| 120 | <td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td> |
| 121 | </tr> |
| 122 | <tr> |
| 123 | <td>crespo</td> |
| 124 | <td>Press and hold <em>Volume Up</em>, then press and hold <em>Power</em></td> |
| 125 | </tr> |
| 126 | <tr> |
| 127 | <td>crespo4g</td> |
| 128 | <td>Press and hold <em>Volume Up</em>, then press and hold <em>Power</em></td> |
| 129 | </tr> |
| 130 | </tbody> |
| 131 | </table> |
| 132 | <p>Also, the command <code>adb reboot bootloader</code> can be used to reboot from |
| 133 | Android directly into the bootloader with no key combinations.</p> |
| 134 | <h2 id="unlocking-the-bootloader">Unlocking the bootloader</h2> |
| 135 | <p>It's only possible to flash a custom system if the bootloader allows it.</p> |
| 136 | <p>The bootloader is locked by default. With the device in fastboot mode, the |
| 137 | bootloader is unlocked with</p> |
| 138 | <pre><code>$ fastboot oem unlock |
| 139 | </code></pre> |
| 140 | <p>The procedure must be confirmed on-screen, and deletes the user data for |
| 141 | privacy reasons. It only needs to be run once.</p> |
| 142 | <p>All data on the phone is erased, i.e. both the applications' private data |
| 143 | and the shared data that is accessible over USB, including photos and |
| 144 | movies. Be sure to make a backup of any precious files you have before |
| 145 | unlocking the bootloader.</p> |
| 146 | <p>On Nexus 10, after unlocking the bootloader, the internal storage is |
| 147 | left unformatted and must be formatted with</p> |
| 148 | <pre><code>$ fastboot format cache |
| 149 | $ fastboot format userdata |
| 150 | </code></pre> |
| 151 | <p>The bootloader can be locked back with</p> |
| 152 | <pre><code>$ fastboot oem lock |
| 153 | </code></pre> |
| 154 | <p>Note that this erases user data on Xoom (including the shared USB data).</p> |
| 155 | <h2 id="obtaining-proprietary-binaries">Obtaining proprietary binaries</h2> |
| 156 | <p>The Android Open-Source Project can't be used |
| 157 | from pure source code only, and requires additional hardware-related proprietary |
| 158 | libraries to run, specifically for hardware graphics acceleration.</p> |
| 159 | <p>Official binaries for Nexus S, Nexus S 4G, Galaxy Nexus, Nexus 7, Nexus 4, |
| 160 | Nexus 10 and PandaBoard |
| 161 | can be downloaded from |
| 162 | <a href="https://developers.google.com/android/nexus/drivers">Google's Nexus driver page</a>, |
| 163 | which add access to additional hardware capabilities with non-Open-Source code.</p> |
| 164 | <p>When using the master branch for a device, the binaries for the most |
| 165 | recent numbered release are the ones that should be used in the master |
| 166 | branch.</p> |
| 167 | <h3 id="extracting-the-proprietary-binaries">Extracting the proprietary binaries</h3> |
| 168 | <p>Each set of binaries comes as a self-extracting script in a compressed archive. |
| 169 | After uncompressing each archive, run the included self-extracting script |
| 170 | from the root of the source tree, confirm that you agree to the terms of the |
| 171 | enclosed license agreement, and the binaries and their matching makefiles |
| 172 | will get installed in the <code>vendor/</code> hierarchy of the source tree.</p> |
| 173 | <h3 id="cleaning-up-when-adding-proprietary-binaries">Cleaning up when adding proprietary binaries</h3> |
| 174 | <p>In order to make sure that the newly installed binaries are properly |
| 175 | taken into account after being extracted, the existing output of any previous |
| 176 | build needs to be deleted with</p> |
| 177 | <pre><code>$ make clobber |
| 178 | </code></pre> |
| 179 | <h2 id="picking-and-building-the-configuration-that-matches-a-device">Picking and building the configuration that matches a device</h2> |
| 180 | <p>The steps to configure and build the Android Open-Source Project |
| 181 | are described in the page about <a href="building-running.html">Building and Running</a>.</p> |
| 182 | <p>The recommended builds for the various devices are available through |
| 183 | the lunch menu, accessed when running the <code>lunch</code> command with no arguments:</p> |
| 184 | <table> |
| 185 | <thead> |
| 186 | <tr> |
| 187 | <th>Device</th> |
| 188 | <th>Branch</th> |
| 189 | <th>Build configuration</th> |
| 190 | </tr> |
| 191 | </thead> |
| 192 | <tbody> |
| 193 | <tr> |
| 194 | <td>manta</td> |
| 195 | <td>android-4.2.1_r1 or master</td> |
| 196 | <td>full_manta-userdebug</td> |
| 197 | </tr> |
| 198 | <tr> |
| 199 | <td>grouper</td> |
| 200 | <td>android-4.2.1_r1 or master</td> |
| 201 | <td>full_grouper-userdebug</td> |
| 202 | </tr> |
| 203 | <tr> |
| 204 | <td>tipalia</td> |
| 205 | <td>android-4.2.1_r1 or master</td> |
| 206 | <td>full_tilapia-userdebug</td> |
| 207 | </tr> |
| 208 | <tr> |
| 209 | <td>maguro</td> |
| 210 | <td>android-4.2.1_r1 or master</td> |
| 211 | <td>full_maguro-userdebug</td> |
| 212 | </tr> |
| 213 | <tr> |
| 214 | <td>toro</td> |
| 215 | <td>android-4.2.1_r1 or master</td> |
| 216 | <td>full_toro-userdebug</td> |
| 217 | </tr> |
| 218 | <tr> |
| 219 | <td>toroplus</td> |
| 220 | <td>master</td> |
| 221 | <td>full_toroplus-userdebug</td> |
| 222 | </tr> |
| 223 | <tr> |
| 224 | <td>panda</td> |
| 225 | <td>master</td> |
| 226 | <td>full_panda-userdebug</td> |
| 227 | </tr> |
| 228 | <tr> |
| 229 | <td>wingray</td> |
| 230 | <td>android-4.1.2_r1</td> |
| 231 | <td>full_wingray-userdebug</td> |
| 232 | </tr> |
| 233 | <tr> |
| 234 | <td>crespo</td> |
| 235 | <td>android-4.1.2_r1</td> |
| 236 | <td>full_crespo-userdebug</td> |
| 237 | </tr> |
| 238 | <tr> |
| 239 | <td>crespo4g</td> |
| 240 | <td>android-4.1.2_r1</td> |
| 241 | <td>full_crespo4g-userdebug</td> |
| 242 | </tr> |
| 243 | </tbody> |
| 244 | </table> |
| 245 | <p>Do not use 4.1.1 on a Nexus 7 that was originally sold with 4.1.2 |
| 246 | or newer.</p> |
| 247 | <h2 id="flashing-a-device">Flashing a device</h2> |
| 248 | <p>Set the device in fastboot mode if necessary (see above).</p> |
| 249 | <p>An entire Android system can be flashed in a single command: this writes |
| 250 | the boot, recovery and system partitions together after verifying that the |
| 251 | system being flashed is compatible with the installed bootloader and radio, |
| 252 | and reboots the system. This also erases all the user data, similarly to |
| 253 | <code>fastboot oem unlock</code> mentioned earlier.</p> |
| 254 | <pre><code>$ fastboot -w flashall |
| 255 | </code></pre> |
| 256 | <p>Note that filesystems created via fastboot on Motorola Xoom aren't working |
| 257 | optimally, and it is strongly recommended to re-create them through recovery</p> |
| 258 | <pre><code>$ adb reboot recovery |
| 259 | </code></pre> |
| 260 | <p>Once in recovery, open the menu (press Power + Volume Up), wipe the cache |
| 261 | partition, then wipe data.</p> |
| 262 | <h2 id="restoring-a-device-to-its-original-factory-state">Restoring a device to its original factory state</h2> |
| 263 | <p>Factory images |
| 264 | for Nexus 10, |
| 265 | for Nexus 4, |
| 266 | for Nexus Q, |
| 267 | for Nexus 7 (all variants), |
| 268 | for Galaxy Nexus (GSM/HSPA+ "yakju" and "takju", |
| 269 | and CDMA/LTE "mysid" and "mysidspr"), |
| 270 | and |
| 271 | for Nexus S and Nexus S 4G (all variants) |
| 272 | are available from |
| 273 | <a href="https://developers.google.com/android/nexus/images">Google's factory image page</a>.</p> |
| 274 | <p>Factory images for the Motorola Xoom are distributed directly by Motorola.</p> |