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