blob: 4b0dad728df96192ddea880e757d0ca898eee30b [file] [log] [blame] [view]
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -07001<!--
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 Queru3e466b02011-10-06 14:34:00 -070019This page complements the main page about [Building](building.html) with
20information that is specific to individual devices.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070021
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070022With the current release, it is possible to build for Nexus 7, for some
23variants of Galaxy Nexus, for a variant of the Motorola Xoom, and for
24all variants of Nexus S and Nexus S 4G. The exact level of functionality
25for each device depends on the availability of the relevant proprietary
26hardware-specific binaries.
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -080027
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070028All variants of Nexus 7 can be used. On Nexus 7, graphics and audio are
Jean-Baptiste Queruc6dd1022012-10-04 14:00:14 -070029functional, as well as WiFi and Bluetooth. Due to hardware differences, do
30not use 4.1.1 on a Nexus 7 that was originally sold with 4.1.2 or newer.
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -080031
Jean-Baptiste Queruc6dd1022012-10-04 14:00:14 -070032The variants of Galaxy Nexus that can be used are the GSM/HSPA+ configuration
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070033"maguro" (only if it was originally sold with a "yakju" or "takju" operating
34system) and the VZW CDMA/LTE configuration "toro". On those devices, graphics
35and audio are functional, as well as WiFi, Bluetooth, and access to the
36respective cellular networks. The orientation sensors are functional.
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -080037
Jean-Baptiste Queruc6dd1022012-10-04 14:00:14 -070038The Sprint CDMA/LTE configuration "toroplus" of Galaxy Nexus is supported
39experimentally. On that configuration, the cellular network is not functional,
40and the other peripherals work like they do on "toro".
41
42The Motorola Xoom can be used in the Wi-Fi configuration "wingray"
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070043sold in the USA. Graphics and audio are functional as well as WiFi and
44Bluetooth and the orientation sensors.
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -070045
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070046All configurations of Nexus S and Nexus S 4G can be used, and on those
47devices all the peripherals are functional: graphics, audio, Wifi, Bluetooth,
48cell networks, sensors, camera, hardware codecs, NFC, GPS.
49
50In addition, [PandaBoard](http://pandaboard.org) a.k.a. "panda" can be used
51in the master branch, but is considered experimental.
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -070052The specific details to use a PandaBoard with the Android Open-Source Project
53are in the file `device/ti/panda/README` in the source tree.
54
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070055Nexus One a.k.a. "passion" is obsolete, was experimental in gingerbread,
56and can't be used with newer versions of the Android Open-Source
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -070057Project.
58
59Android Developer Phones (ADP1 and ADP2, a.k.a. "dream" and "sapphire") are
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070060obsolete, were experimental in froyo, and can't be used with
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -070061newer versions of the Android Open-Source Project.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070062
63## Building fastboot and adb ##
64
65If you don't already have those tools, fastboot and adb can be built with
66the regular build system. Follow the instructions on the page about
67[building](building.html), and replace the main `make` command with
68
69 $ make fastboot adb
70
71## Booting into fastboot mode ##
72
73During a cold boot, the following key combinations can be used to boot into fastboot mode,
74which is a mode in the bootloader that can be used to flash the devices:
75
76Device | Keys
77---------|------
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070078grouper | Press *Power* for a second, and press *Volume Down* when the bootloader logo appears
Jean-Baptiste Queru60a47f32012-10-08 14:55:09 -070079phantasm | Power the device, cover it with one hand after the LEDs light up and until they turn red
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -070080maguro | Press and hold both *Volume Up* and *Volume Down*, then press and hold *Power*
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070081toro | Press and hold both *Volume Up* and *Volume Down*, then press and hold *Power*
Conley Owens9aaa52a2012-02-03 14:13:27 -080082panda | Press and hold *Input*, then press *Power*
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -080083wingray | Press and hold *Volume Down*, then press and hold *Power*
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070084crespo | Press and hold *Volume Up*, then press and hold *Power*
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070085crespo4g | Press and hold *Volume Up*, then press and hold *Power*
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070086passion | Press and hold the trackball, then press *Power*
87sapphire | Press and hold *Back*, then press *Power*
88dream | Press and hold *Back*, then press *Power*
89
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070090Also, the command `adb reboot bootloader` can be used to reboot from
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -070091Android directly into the bootloader with no key combinations.
92
93## Unlocking the bootloader ##
94
95It's only possible to flash a custom system if the bootloader allows it.
96
97This is the default setup on ADP1 and ADP2.
98
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -070099On Nexus One, Nexus S, Nexus S 4G, Xoom, Galaxy Nexus, and Nexus 7,
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -0800100the bootloader is locked by default. With the device in fastboot mode, the
101bootloader is unlocked with
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700102
103 $ fastboot oem unlock
104
105The procedure must be confirmed on-screen, and deletes the user data for
106privacy reasons. It only needs to be run once.
107
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700108Note that on the Nexus S, Nexus S 4G, Motorola Xoom, Galaxy Nexus,
109and on Nexus 7,
Jean-Baptiste Queru93afea92011-12-16 18:25:07 -0800110all data on the phone is erased, i.e. both the applications' private data
111and the shared data that is accessible over USB, including photos and
112movies. Be sure to make a backup of any precious files you have before
113unlocking the bootloader.
114
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700115On Nexus One, the operation voids the warranty and is irreversible.
116
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700117On Nexus S, Nexus S 4G, Xoom, Galaxy Nexus, and Nexus 7,
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -0800118the bootloader can be locked back with
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700119
120 $ fastboot oem lock
121
Jean-Baptiste Queru93afea92011-12-16 18:25:07 -0800122Note that this erases user data on Xoom (including the shared USB data).
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -0800123
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700124## Obtaining proprietary binaries ##
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700125
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700126Starting with Ice Cream Sandwich, the Android Open-Source Project can't be used
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -0700127from pure source code only, and requires additional hardware-related proprietary
128libraries to run, specifically for hardware graphics acceleration.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700129
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700130Official binaries for Nexus S, Nexus S 4G, Galaxy Nexus, Nexus 7, and PandaBoard
131can be downloaded from
Jean-Baptiste Queru66426b32012-04-20 07:14:05 -0700132[Google's Nexus driver page](https://developers.google.com/android/nexus/drivers),
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700133which add access to additional hardware capabilities with non-Open-Source code.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700134
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700135When using the master branch for a device, the binaries for the most
Jean-Baptiste Queru993d0b82012-04-19 17:24:35 -0700136recent numbered release are the ones that should be used in the master
137branch.
138
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700139There are limited binaries for Nexus One, and none for ADP2 or ADP1.
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700140
141### Extracting the proprietary binaries ###
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700142
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -0700143Each set of binaries comes as a self-extracting script in a compressed archive.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700144After uncompressing each archive, run the included self-extracting script
145from the root of the source tree, confirm that you agree to the terms of the
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700146enclosed license agreement, and the binaries and their matching makefiles
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700147will get installed in the `vendor/` hierarchy of the source tree.
148
Jean-Baptiste Queru5da75392011-05-17 14:32:56 -0700149### Cleaning up when adding proprietary binaries ###
150
151In order to make sure that the newly installed binaries are properly
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700152taken into account after being extracted, the existing output of any previous
153build needs to be deleted with
154
155 $ make clobber
156
157## Picking and building the configuration that matches a device ##
158
159The steps to configure and build the Android Open-Source Project
160are described in the page about [Building](building.html).
161
162The recommended builds for the various devices are available through
Jean-Baptiste Queru3e466b02011-10-06 14:34:00 -0700163the lunch menu, accessed when running the `lunch` command with no arguments:
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700164
Jean-Baptiste Queru993d0b82012-04-19 17:24:35 -0700165Device | Branch | Build configuration
166---------|------------------------------|------------------------
Jean-Baptiste Queruc6dd1022012-10-04 14:00:14 -0700167grouper | android-4.1.2_r1 or master | full_grouper-userdebug
168maguro | android-4.1.2_r1 or master | full_maguro-userdebug
169toro | android-4.1.2_r1 or master | full_toro-userdebug
170toroplus | master | full_toroplus-userdebug
Jean-Baptiste Queru993d0b82012-04-19 17:24:35 -0700171panda | master | full_panda-userdebug
Jean-Baptiste Queruc6dd1022012-10-04 14:00:14 -0700172wingray | android-4.1.2_r1 or master | full_wingray-userdebug
173crespo | android-4.1.2_r1 or master | full_crespo-userdebug
174crespo4g | android-4.1.2_r1 or master | full_crespo4g-userdebug
Jean-Baptiste Queru993d0b82012-04-19 17:24:35 -0700175passion | android-2.3.7_r1 | full_passion-userdebug
176sapphire | android-2.2.3_r1 | full_sapphire-userdebug
177dream | android-2.2.3_r1 | full_dream-userdebug
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700178
Jean-Baptiste Queruc6dd1022012-10-04 14:00:14 -0700179Do not use 4.1.1 on a Nexus 7 that was originally sold with 4.1.2
180or newer.
181
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700182## Flashing a device ##
183
184Set the device in fastboot mode if necessary (see above).
185
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700186An entire Android system can be flashed in a single command: this writes
Jean-Baptiste Queruccdda522011-05-19 10:47:27 -0700187the boot, recovery and system partitions together after verifying that the
Jean-Baptiste Queru61745ea2011-09-08 14:44:15 -0700188system being flashed is compatible with the installed bootloader and radio,
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700189and reboots the system. This also erases all the user data, similarly to
190`fastboot oem unlock` mentioned earlier.
Jean-Baptiste Querub4d39b42011-04-11 13:53:58 -0700191
192 $ fastboot -w flashall
193
Jean-Baptiste Queru35f51012011-12-14 09:32:22 -0800194Note that filesystems created via fastboot on Motorola Xoom aren't working
195optimally, and it is strongly recommended to re-create them through recovery
196
197 $ adb reboot recovery
198
199Once in recovery, open the menu (press Power + Volume Up), wipe the cache
200partition, then wipe data.
201
Jean-Baptiste Queru93afea92011-12-16 18:25:07 -0800202## Restoring a device to its original factory state ##
203
Jean-Baptiste Queru0318a192012-04-05 08:13:08 -0700204Factory images
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700205for Nexus 7,
206for Galaxy Nexus (GSM/HSPA+ "yakju" and "takju", and CDMA/LTE "mysid"),
Jean-Baptiste Queru0318a192012-04-05 08:13:08 -0700207and
Jean-Baptiste Queruc10820f2012-07-17 13:33:48 -0700208for Nexus S and Nexus S 4G (all variants)
Jean-Baptiste Queru0318a192012-04-05 08:13:08 -0700209are available from
Jean-Baptiste Queru66426b32012-04-20 07:14:05 -0700210[Google's factory image page](https://developers.google.com/android/nexus/images).
Jean-Baptiste Queru93afea92011-12-16 18:25:07 -0800211
212Factory images for the Motorola Xoom are distributed directly by Motorola.
213
Jean-Baptiste Queru0318a192012-04-05 08:13:08 -0700214No factory images are available for Nexus One.