blob: 5bb2f2c6afbf61c5a244b583af39a736beecd22a [file] [log] [blame]
Robert Ly35f2fda2013-01-29 16:27:05 -08001page.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
29information that is specific to individual devices.</p>
Robert Ly40e3b6d2013-04-17 18:12:10 -070030
Robert Ly35f2fda2013-01-29 16:27:05 -080031<p>With the current release, it is possible to build for
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -070032Nexus 4, Nexus 7, and for some variants of Galaxy Nexus.
Robert Ly35f2fda2013-01-29 16:27:05 -080033The exact level of functionality for each device depends on the availability
34of the relevant proprietary hardware-specific binaries.</p>
Robert Ly40e3b6d2013-04-17 18:12:10 -070035<p>For Nexus 4 "mako" and on Nexus 7 "grouper" (Wi-Fi) and "tilapia" (Mobile),
36all configurations can be used,
37and all the hardware is functional.
38Due to hardware differences, do not use 4.1.1 on a Nexus 7 that
39was originally sold with 4.1.2 or newer.</p>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -070040<p>All configurations of Nexus 10 "manta" can be used with 4.2.2.
41On those devices, graphics, audio,
Robert Ly35f2fda2013-01-29 16:27:05 -080042Wi-Fi, Bluetooth, camera, NFC, GPS and orientation sensors are functional.</p>
Robert Ly35f2fda2013-01-29 16:27:05 -080043<p>The variants of Galaxy Nexus that can be used are the GSM/HSPA+ configuration
44"maguro" (only if it was originally sold with a "yakju" or "takju" operating
45system) and the VZW CDMA/LTE configuration "toro". On those devices, graphics
46and audio are functional, as well as Wi-Fi, Bluetooth, and access to the
47respective cellular networks. NFC and the orientation sensors are functional.</p>
48<p>The Sprint CDMA/LTE configuration "toroplus" of Galaxy Nexus is supported
Robert Ly40e3b6d2013-04-17 18:12:10 -070049experimentally, in the jb-mr1-dev-plus-aosp branch. On that configuration,
50the cellular network is not functional,
Robert Ly35f2fda2013-01-29 16:27:05 -080051and the other peripherals work like they do on "toro".</p>
52<p>The Motorola Xoom can be used in the Wi-Fi configuration "wingray"
53sold in the USA, with Android 4.1.2. Graphics and audio are functional
54as well as Wi-Fi and Bluetooth and the orientation sensors.</p>
55<p>All configurations of Nexus S and Nexus S 4G can be used with Android 4.1.2.
Robert Ly40e3b6d2013-04-17 18:12:10 -070056On those devices all the hardware is functional.</p>
Robert Ly35f2fda2013-01-29 16:27:05 -080057<p>In addition, <a href="http://pandaboard.org">PandaBoard</a> a.k.a. "panda" can be used
Robert Ly40e3b6d2013-04-17 18:12:10 -070058in the jb-mr1-dev-plus-aosp branch, but is considered experimental.
Robert Ly35f2fda2013-01-29 16:27:05 -080059The specific details to use a PandaBoard with the Android Open-Source Project
60are in the file <code>device/ti/panda/README</code> in the source tree.</p>
Robert Ly40e3b6d2013-04-17 18:12:10 -070061
Robert Ly35f2fda2013-01-29 16:27:05 -080062<h2 id="building-fastboot-and-adb">Building fastboot and adb</h2>
63<p>If you don't already have those tools, fastboot and adb can be built with
64the regular build system. Follow the instructions on the page about
65<a href="building-running.html">Building and Running</a>, and replace the main <code>make</code> command with</p>
66<pre><code>$ make fastboot adb
67</code></pre>
68<h2 id="booting-into-fastboot-mode">Booting into fastboot mode</h2>
69<p>During a cold boot, the following key combinations can be used to boot into fastboot mode,
70which is a mode in the bootloader that can be used to flash the devices:</p>
71<table>
72<thead>
73<tr>
74<th>Device</th>
75<th>Keys</th>
76</tr>
77</thead>
78<tbody>
79<tr>
80<td>manta</td>
81<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
82</tr>
83<tr>
84<td>mako</td>
85<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
86</tr>
87<tr>
88<td>grouper</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -070089<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
Robert Ly35f2fda2013-01-29 16:27:05 -080090</tr>
91<tr>
92<td>tilapia</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -070093<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
Robert Ly35f2fda2013-01-29 16:27:05 -080094</tr>
95<tr>
96<td>phantasm</td>
97<td>Power the device, cover it with one hand after the LEDs light up and until they turn red</td>
98</tr>
99<tr>
100<td>maguro</td>
101<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
102</tr>
103<tr>
104<td>toro</td>
105<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
106</tr>
107<tr>
108<td>toroplus</td>
109<td>Press and hold both <em>Volume Up</em> and <em>Volume Down</em>, then press and hold <em>Power</em></td>
110</tr>
111<tr>
112<td>panda</td>
113<td>Press and hold <em>Input</em>, then press <em>Power</em></td>
114</tr>
115<tr>
116<td>wingray</td>
117<td>Press and hold <em>Volume Down</em>, then press and hold <em>Power</em></td>
118</tr>
119<tr>
120<td>crespo</td>
121<td>Press and hold <em>Volume Up</em>, then press and hold <em>Power</em></td>
122</tr>
123<tr>
124<td>crespo4g</td>
125<td>Press and hold <em>Volume Up</em>, then press and hold <em>Power</em></td>
126</tr>
127</tbody>
128</table>
129<p>Also, the command <code>adb reboot bootloader</code> can be used to reboot from
130Android directly into the bootloader with no key combinations.</p>
131<h2 id="unlocking-the-bootloader">Unlocking the bootloader</h2>
132<p>It's only possible to flash a custom system if the bootloader allows it.</p>
133<p>The bootloader is locked by default. With the device in fastboot mode, the
134bootloader is unlocked with</p>
135<pre><code>$ fastboot oem unlock
136</code></pre>
137<p>The procedure must be confirmed on-screen, and deletes the user data for
138privacy reasons. It only needs to be run once.</p>
139<p>All data on the phone is erased, i.e. both the applications' private data
140and the shared data that is accessible over USB, including photos and
141movies. Be sure to make a backup of any precious files you have before
142unlocking the bootloader.</p>
143<p>On Nexus 10, after unlocking the bootloader, the internal storage is
144left unformatted and must be formatted with</p>
145<pre><code>$ fastboot format cache
146$ fastboot format userdata
147</code></pre>
148<p>The bootloader can be locked back with</p>
149<pre><code>$ fastboot oem lock
150</code></pre>
151<p>Note that this erases user data on Xoom (including the shared USB data).</p>
152<h2 id="obtaining-proprietary-binaries">Obtaining proprietary binaries</h2>
153<p>The Android Open-Source Project can't be used
154from pure source code only, and requires additional hardware-related proprietary
155libraries to run, specifically for hardware graphics acceleration.</p>
Robert Ly40e3b6d2013-04-17 18:12:10 -0700156<p>Official binaries for the supported devices can be downloaded from
Robert Ly35f2fda2013-01-29 16:27:05 -0800157<a href="https://developers.google.com/android/nexus/drivers">Google's Nexus driver page</a>,
158which add access to additional hardware capabilities with non-Open-Source code.</p>
Robert Ly40e3b6d2013-04-17 18:12:10 -0700159<p>When building the master branch for a device, the binaries for the most
160recent numbered release or with the most recent date
161are the ones that should be used.</p>
Robert Ly35f2fda2013-01-29 16:27:05 -0800162<h3 id="extracting-the-proprietary-binaries">Extracting the proprietary binaries</h3>
163<p>Each set of binaries comes as a self-extracting script in a compressed archive.
164After uncompressing each archive, run the included self-extracting script
165from the root of the source tree, confirm that you agree to the terms of the
166enclosed license agreement, and the binaries and their matching makefiles
167will get installed in the <code>vendor/</code> hierarchy of the source tree.</p>
168<h3 id="cleaning-up-when-adding-proprietary-binaries">Cleaning up when adding proprietary binaries</h3>
169<p>In order to make sure that the newly installed binaries are properly
170taken into account after being extracted, the existing output of any previous
171build needs to be deleted with</p>
172<pre><code>$ make clobber
173</code></pre>
174<h2 id="picking-and-building-the-configuration-that-matches-a-device">Picking and building the configuration that matches a device</h2>
175<p>The steps to configure and build the Android Open-Source Project
Robert Ly40e3b6d2013-04-17 18:12:10 -0700176are described in the page about <a href="building.html">Building</a>.</p>
Robert Ly35f2fda2013-01-29 16:27:05 -0800177<p>The recommended builds for the various devices are available through
178the lunch menu, accessed when running the <code>lunch</code> command with no arguments:</p>
179<table>
180<thead>
181<tr>
182<th>Device</th>
183<th>Branch</th>
184<th>Build configuration</th>
185</tr>
186</thead>
187<tbody>
188<tr>
189<td>manta</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700190<td>android-4.2.2_r1</td>
Robert Ly35f2fda2013-01-29 16:27:05 -0800191<td>full_manta-userdebug</td>
192</tr>
193<tr>
Robert Ly40e3b6d2013-04-17 18:12:10 -0700194<td>mako</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700195<td>android-4.3_r1 or master</td>
196<td>aosp_mako-userdebug</td>
Robert Ly40e3b6d2013-04-17 18:12:10 -0700197</tr>
198<tr>
Robert Ly35f2fda2013-01-29 16:27:05 -0800199<td>grouper</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700200<td>android-4.3_r1 or master</td>
201<td>aosp_grouper-userdebug</td>
Robert Ly35f2fda2013-01-29 16:27:05 -0800202</tr>
203<tr>
Robert Ly40e3b6d2013-04-17 18:12:10 -0700204<td>tilapia</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700205<td>android-4.3_r1 or master</td>
206<td>aosp_grouper-userdebug</td>
Robert Ly35f2fda2013-01-29 16:27:05 -0800207</tr>
208<tr>
209<td>maguro</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700210<td>android-4.3_r1 or master</td>
211<td>aosp_maguro-userdebug</td>
Robert Ly35f2fda2013-01-29 16:27:05 -0800212</tr>
213<tr>
214<td>toro</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700215<td>android-4.3_r1 or master</td>
216<td>aosp_toro-userdebug</td>
Robert Ly35f2fda2013-01-29 16:27:05 -0800217</tr>
218<tr>
219<td>toroplus</td>
220<td>master</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700221<td>aosp_toroplus-userdebug</td>
Robert Ly35f2fda2013-01-29 16:27:05 -0800222</tr>
223<tr>
224<td>panda</td>
225<td>master</td>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700226<td>aosp_panda-userdebug</td>
Robert Ly35f2fda2013-01-29 16:27:05 -0800227</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
246or 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
250the boot, recovery and system partitions together after verifying that the
251system being flashed is compatible with the installed bootloader and radio,
252and 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
257optimally, 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
261partition, 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
264for Nexus 10,
265for Nexus 4,
266for Nexus Q,
Robert Ly40e3b6d2013-04-17 18:12:10 -0700267for Nexus 7,
Robert Ly35f2fda2013-01-29 16:27:05 -0800268for Galaxy Nexus (GSM/HSPA+ "yakju" and "takju",
269and CDMA/LTE "mysid" and "mysidspr"),
270and
Robert Ly40e3b6d2013-04-17 18:12:10 -0700271for Nexus S and Nexus S 4G
Robert Ly35f2fda2013-01-29 16:27:05 -0800272are available from
273<a href="https://developers.google.com/android/nexus/images">Google's factory image page</a>.</p>
Jean-Baptiste Querud8fbf202013-06-18 14:51:12 -0700274<p>Factory images for the Motorola Xoom are distributed directly by Motorola.</p>