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 19This page complements the main page about [Building](building.html) with information 20that is specific to individual devices. 21 22The only supported devices are Nexus S, a.k.a. "crespo", and Nexus S 4G, a.k.a. 23"crespo4g". 24Nexus S is the recommended device to use with the Android Open-Source Project. 25Nexus One a.k.a. "passion" is experimental and unsupported. Android Developer 26Phones (ADP1 and ADP2, a.k.a. "dream" and "sapphire") are obsolete, were 27experimental and unsupported in froyo, and can't be used with gingerbread. 28 29## Building fastboot and adb ## 30 31If you don't already have those tools, fastboot and adb can be built with 32the regular build system. Follow the instructions on the page about 33[building](building.html), and replace the main `make` command with 34 35 $ make fastboot adb 36 37## Booting into fastboot mode ## 38 39During a cold boot, the following key combinations can be used to boot into fastboot mode, 40which is a mode in the bootloader that can be used to flash the devices: 41 42Device | Keys 43---------|------ 44crespo | Press and hold *Volume Up*, then press and hold *Power* 45crespo4g | Press and hold *Volume Up*, then press and hold *Power* 46passion | Press and hold the trackball, then press *Power* 47sapphire | Press and hold *Back*, then press *Power* 48dream | Press and hold *Back*, then press *Power* 49 50Also, on devices running froyo or later where adb is enabled, 51the command `adb reboot bootloader` can be used to reboot from 52Android directly into the bootloader with no key combinations. 53 54## Unlocking the bootloader ## 55 56It's only possible to flash a custom system if the bootloader allows it. 57 58This is the default setup on ADP1 and ADP2. 59 60On Nexus One, Nexus S, and Nexus S 4G, the bootloader is locked by default. 61With the device in fastboot mode, the bootloader is unlocked with 62 63 $ fastboot oem unlock 64 65The procedure must be confirmed on-screen, and deletes the user data for 66privacy reasons. It only needs to be run once. 67 68On Nexus One, the operation voids the warranty and is irreversible. 69 70On Nexus S and Nexus S 4G, the bootloader can be locked back with 71 72 $ fastboot oem lock 73 74## Obtaining proprietary binaries ## 75 76While it's possible to build and run a system using exclusively source code 77from Android Open-Source Project, such a system can only use the devices' 78hardware capabilities for which Open-Source support exists. 79 80Official binaries for Nexus S and Nexus S 4G can be downloaded from 81[Google's Nexus driver page](http://code.google.com/android/nexus/drivers.html), 82which add access to additional hardware capabilities with non-Open-Source code. 83 84There are no official binaries for Nexus One, ADP2 or ADP1. 85 86### Extracting the proprietary binaries ### 87 88Each driver comes as a self-extracting script in a compressed archive. 89After uncompressing each archive, run the included self-extracting script 90from the root of the source tree, confirm that you agree to the terms of the 91enclosed license agreement, and the binaries and their matching makefiles 92will get installed in the `vendor/` hierarchy of the source tree. 93 94There's an additional step on Nexus S 4G. Build the signapk tool with 95 96 $ make signapk 97 98Then reassemble the proprietary applicatons with 99 100 $ vendor/samsung/crespo4g/reassemble-apks.sh 101 102### Cleaning up when adding proprietary binaries ### 103 104In order to make sure that the newly installed binaries are properly 105taken into account after being extracted, the existing output of any previous 106build needs to be deleted with 107 108 $ make clobber 109 110## Picking and building the configuration that matches a device ## 111 112The steps to configure and build the Android Open-Source Project 113are described in the page about [Building](building.html). 114 115The recommended builds for the various devices are available through 116the lunch menu, accesed when running the `lunch` command with no arguments: 117 118Device | Branch | Build configuration 119---------|------------------|------------------------ 120crespo | android-2.3.5_r1 | full_crespo-userdebug 121crespo4g | android-2.3.5_r1 | full_crespo4g-userdebug 122passion | android-2.3.5_r1 | full_passion-userdebug 123sapphire | android-2.2.2_r1 | full_sapphire-userdebug 124dream | android-2.2.2_r1 | full_dream-userdebug 125 126## Flashing a device ## 127 128Set the device in fastboot mode if necessary (see above). 129 130Because user data is typically incompatible between builds of Android, 131it's typically better to delete it when flashing a new system. 132 133 $ fastboot erase cache 134 $ fastboot erase userdata 135 136An entire Android system can be flashed in a single command: this writes 137the boot, recovery and system partitions together after verifying that the 138system being flashed is compatible with the installed bootloader and radio, 139and reboots the system. 140 141 $ fastboot flashall 142 143On crespo, crespo4g, sapphire and dream (but not on passion), the commands above can 144be replaced with a single command 145 146 $ fastboot -w flashall 147 148### Nexus S and Nexus S 4G Bootloader and Cell Radio compatibility ### 149 150On Nexus S and Nexus S 4G, each version of Android has only been thoroughly 151tested with on specific version of the underlying bootloader and cell radio 152software. 153However, no compatibility issues are expected when running newer systems 154with older bootloaders and radio images according to the following tables. 155 156Nexus S (worldwide version "XX"): 157 158Android Version | Preferred Bootloader | Preferred Radio | Also possible 159----------------|----------------------|-----------------|-------------- 1602.3 (GRH55) | I9020XXJK1 | I9020XXJK8 1612.3.1 (GRH78) | I9020XXJK1 | I9020XXJK8 1622.3.2 (GRH78C) | I9020XXJK1 | I9020XXJK8 1632.3.3 (GRI40) | I9020XXKA3 | I9020XXKB1 | All previous versions 1642.3.4 (GRJ22) | I9020XXKA3 | I9020XXKD1 | All previous versions 1652.3.5 (GRJ90) | I9020XXKA3 | I9020XXKF1 | All previous versions 1662.3.6 (GRK39F) | I9020XXKA3 | I9020XXKF1 | All previous versions 167 168Nexus S (850MHz version "UC"): 169 170Android Version | Preferred Bootloader | Preferred Radio | Also possible 171----------------|----------------------|-----------------|-------------- 1722.3.3 (GRI54) | I9020XXKA3 | I9020UCKB2 1732.3.4 (GRJ22) | I9020XXKA3 | I9020UCKD1 | All previous versions 1742.3.5 (GRJ90) | I9020XXKA3 | I9020UCKF1 | All previous versions 1752.3.6 (GRK39C) | I9020XXKA3 | I9020UCKF1 | All previous versions 1762.3.6 (GRK39F) | I9020XXKA3 | I9020UCKF1 | All previous versions 177 178Nexus S (Korea version "KR"): 179 180Android Version | Preferred Bootloader | Preferred Radio | Also possible 181----------------|----------------------|-----------------|-------------- 1822.3.3 (GRI54) | I9020XXKA3 | I9020KRKB3 1832.3.4 (GRJ22) | I9020XXKA3 | M200KRKC1 | All previous versions 1842.3.5 (GRJ90) | I9020XXKA3 | M200KRKC1 | All previous versions 1852.3.6 (GRK39F) | I9020XXKA3 | M200KRKC1 | All previous versions 186 187Nexus S 4G: 188 189Android Version | Preferred Bootloader | Preferred Radio | Also possible 190----------------|----------------------|-----------------|-------------- 1912.3.4 (GRJ06D) | D720SPRKC5 | D720SPRKC9 1922.3.4 (GRJ22) | D720SPRKC5 | D720SPRKD8 | All previous versions 1932.3.5 (GRJ90) | D720SPRKC5 | D720SPRKE5 | All previous versions 1942.3.7 (GWK74) | D720SPRKE1 | D720SPRKH1 (*) | All previous versions 195 196If you're building a new version of Android, if your Nexus S or Nexus S 4G has 197an older bootloader and radio image that is marked as being also possible in 198the table above but is not recognized by fastboot, you can locally 199delete the `version-bootloader` and `version-baseband` lines in 200`device/samsung/crespo/board-info.txt` or `device/samsung/crespo4g/board-info.txt`. 201 202(*) As a note, radio version D720SPRKH1 for Nexus S 4G sometimes erroneously 203reports version D720SPRKE1. If this is the case for your Nexus S 4G, you can 204locally modify the version-baseband line in 205`device/samsung/crespo4g/board-info.txt` accordingly. 206