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