| <html devsite> |
| <head> |
| <title>Running Builds</title> |
| <meta name="project_path" value="/_project.yaml" /> |
| <meta name="book_path" value="/_book.yaml" /> |
| </head> |
| <body> |
| <!-- |
| Copyright 2019 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| |
| |
| <p>This page provides details for running builds on specific devices and |
| complements the information in <a href="building.html">Preparing to Build</a>. |
| </p> |
| |
| <h2 id="building-fastboot-and-adb">Building fastboot and adb</h2> |
| <p>If you don't already have <code>fastboot</code> and <code>adb</code>, you can |
| build them with the regular build system. Use the instructions in |
| <a href="building.html">Preparing to Build</a> and replace the |
| main <code>make</code> command with:</p> |
| <pre class="devsite-click-to-copy devsite-terminal">make fastboot adb</pre> |
| |
| <h2 id="booting-into-fastboot-mode">Booting into fastboot mode</h2> |
| <p><code>Fastboot</code> is a bootloader mode in which you can flash a device. |
| During a cold boot of a device, use the following key combinations to boot into |
| <code>fastboot</code> mode.</p> |
| <p>You can use the command <code>adb reboot bootloader</code> to reboot |
| directly into the bootloader, or you can use one of the following key combinations |
| during a cold boot.</p> |
| <table> |
| <thead> |
| <tr> |
| <th>Device</th> |
| <th>Code name</th> |
| <th>Keys</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td>Pixel 3 XL</td> |
| <td>crosshatch</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Pixel 3</td> |
| <td>blueline</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Pixel 2 XL</td> |
| <td>taimen</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Pixel 2</td> |
| <td>walleye</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Pixel XL</td> |
| <td>marlin</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Pixel</td> |
| <td>sailfish</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>hikey</td> |
| <td>hikey</td> |
| <td>Link pins 1 - 2 and 5 - 6 of J15.</td> |
| </tr> |
| <tr> |
| <td>Nexus 6P</td> |
| <td>angler</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 5X</td> |
| <td>bullhead</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 6</td> |
| <td>shamu</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus Player</td> |
| <td>fugu</td> |
| <td>Press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 9</td> |
| <td>volantis</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 5</td> |
| <td>hammerhead</td> |
| <td>Press and hold both <strong>Volume Up</strong> and <strong>Volume Down</strong>, then press |
| and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 7</td> |
| <td>flo</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 7 3G</td> |
| <td>deb</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 10</td> |
| <td>manta</td> |
| <td>Press and hold both <strong>Volume Up</strong> and <strong>Volume Down</strong>, then press |
| and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 4</td> |
| <td>mako</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 7 (2012)</td> |
| <td>grouper</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus 7 3G (2012)</td> |
| <td>tilapia</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus Q</td> |
| <td>phantasm</td> |
| <td>Power the device then cover it with one hand after the LEDs light up and |
| until they turn red.</td> |
| </tr> |
| <tr> |
| <td>Galaxy Nexus GSM</td> |
| <td>maguro</td> |
| <td>Press and hold both <strong>Volume Up</strong> and <strong>Volume Down</strong>, then press |
| and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Galaxy Nexus (Verizon)</td> |
| <td>toro</td> |
| <td>Press and hold both <strong>Volume Up</strong> and <strong>Volume Down</strong>, then press |
| and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Galaxy Nexus (Sprint)</td> |
| <td>toroplus</td> |
| <td>Press and hold both <strong>Volume Up</strong> and <strong>Volume Down</strong>, then press |
| and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Motorola Xoom</td> |
| <td>wingray</td> |
| <td>Press and hold <strong>Volume Down</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus S</td> |
| <td>crespo</td> |
| <td>Press and hold <strong>Volume Up</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| <tr> |
| <td>Nexus SG</td> |
| <td>crespo4g</td> |
| <td>Press and hold <strong>Volume Up</strong>, then press and hold <strong>Power</strong>.</td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <h2 id="unlocking-the-bootloader">Unlocking the bootloader</h2> |
| |
| <p>You can flash a custom system only if the bootloader allows it, and the |
| bootloader is locked by default. You can unlock the bootloader, but doing so |
| deletes user data for privacy reasons. After unlocking, <em>all</em> data on the |
| device is erased, that is, both application private data and shared data accessible |
| over USB (including photos and movies). Before attempting to unlock the |
| bootloader, back up any important files on the device.</p> |
| |
| <p>You need to unlock the bootloader only once, and you can re-lock it if |
| necessary.</p> |
| |
| <h3>Unlocking recent devices</h3> |
| <p>All Nexus and Pixel devices released since 2014 (starting with Nexus 6 and |
| Nexus 9) have factory-reset protection and require a multi-step process to |
| unlock the bootloader.</p> |
| |
| <ol> |
| <li>To enable OEM unlocking on the device: |
| <ol> |
| <li>In Settings, tap <strong>About phone</strong>, then tap <strong>Build |
| number</strong> seven (7) times.</li> |
| <li>When you see the message <em>You are a developer</em>, tap the <strong>back</strong> button.</li> |
| <li>Tap <strong>Developer options</strong> and enable |
| <strong>OEM unlocking</strong> and <strong>USB debugging</strong>. (If <strong>OEM |
| unlocking</strong> is disabled, connect to the internet so the device can check in at |
| least once. If it remains disabled, your device may be SIM locked by your |
| carrier and the bootloader can't be unlocked.)</li> |
| </ol> |
| </li> |
| <li>Reboot into the bootloader and use <code>fastboot</code> to unlock it. |
| <ul> |
| <li>For newer devices (2015 and later): |
| <pre class="devsite-click-to-copy devsite-terminal">fastboot flashing unlock</pre> |
| </li> |
| <li>For older devices (2014 and earlier): |
| <pre class="devsite-click-to-copy devsite-terminal">fastboot oem unlock</pre> |
| </li> |
| </ul> |
| </li> |
| <li>Confirm the unlock onscreen.</li> |
| </ol> |
| |
| <aside class="note"><strong>Note:</strong> On Nexus 10, after unlocking the |
| bootloader, the internal storage remains unformatted. You can format the device |
| using <code>fastboot format cache</code> followed by |
| <code>fastboot format userdata</code>.</aside> |
| |
| <h3 id="relocking-the-bootloader">Re-locking the bootloader</h3> |
| <p>To re-lock the bootloader:</p> |
| <ul> |
| <li>For newer devices (2015 and later): |
| <pre class="devsite-click-to-copy devsite-terminal">fastboot flashing lock</pre> |
| </li> |
| <li>For older devices (2014 and earlier): |
| <pre class="devsite-click-to-copy devsite-terminal">fastboot oem lock</pre> |
| </li> |
| </ul> |
| |
| <aside class="note"><strong>Note:</strong> Re-locking the bootloading on a |
| Motorola Xoom erases all user data (including the shared USB data).</aside> |
| |
| <h2 id="flash-unlock">Using flash lock states</h2> |
| <p>The <code>getFlashLockState()</code> system API transmits the bootloader |
| state and the <code>PersistentDataBlockManager.getFlashLockState()</code> system |
| API returns the bootloader’s lock status on compliant devices.</p> |
| |
| <table> |
| <tr> |
| <th>Return value</th> |
| <th>Conditions</th> |
| </tr> |
| <tr> |
| <td><code>FLASH_LOCK_UNKNOWN</code></td> |
| <td>Returned only by devices upgrading to Android 7.x or higher that didn't |
| previously support the bootloader changes required to get the flash lock |
| status if they supported flashing lock/unlock capability.<br> |
| <ul> |
| <li>New devices running Android 7.x or higher must be in either a |
| <code>FLASH_LOCK_LOCKED</code> or <code>FLASH_LOCK_UNLOCKED</code> state.</li> |
| <li>Devices upgrading to Android 7.x or higher that don't support flashing |
| unlock/lock capability should return a <code>FLASH_LOCK_LOCKED</code> state.</li> |
| </ul> |
| </td> |
| </tr> |
| <tr> |
| <td><code>FLASH_LOCK_LOCKED</code></td> |
| <td>Returned by any device that doesn't support flashing |
| lock/unlock (that is, the device is always locked), or any device that supports |
| flashing lock/unlock and is in the locked state.</td> |
| </tr> |
| <tr> |
| <td><code>FLASH_LOCK_UNLOCKED</code></td> |
| <td>Returned by any device that supports flashing lock/unlock and is |
| in the unlocked state.</td> |
| </tr> |
| </table> |
| |
| <p>Manufacturers should test the values returned by devices with locked and |
| unlocked bootloaders. For an example, the Android Open Source Project (AOSP) |
| contains a reference implementation that returns a value based on the |
| <code>ro.boot.flash.locked</code> boot property. Example code is located in the |
| following directories:</p> |
| |
| <ul> |
| <li><code>frameworks/base/services/core/java/com/android/server/PersistentDataBlockService.java</code></li> |
| <li><code>frameworks/base/core/java/android/service/persistentdata/PersistentDataBlockManager.java</code></li> |
| </ul> |
| |
| <h2 id="selecting-device-build">Selecting a device build</h2> |
| |
| <p>The recommended device builds are available from the <code>lunch</code> |
| menu, accessed when running the <code>lunch</code> command with no arguments. See |
| <a href="building#choose-a-target">Choosing a target</a> for available build types and more |
| information on the <code>lunch</code> command.</p> |
| |
| <p>You can download factory images and binaries for Nexus devices from |
| <a href="https://developers.google.com/" class="external" >developers.google.com</a>. |
| See <a href="requirements#binaries">Device binaries</a> for downloads. |
| For details and additional resources, see <a |
| href="building.html#obtaining-proprietary-binaries">Obtaining proprietary |
| binaries</a>. |
| |
| <table> |
| <thead> |
| <tr> |
| <th>Device</th> |
| <th>Code name</th> |
| <th>Build configuration</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td>Pixel 3 XL</td> |
| <td>crosshatch</td> |
| <td>aosp_crosshatch-userdebug</td> |
| </tr> |
| <tr> |
| <td>Pixel 3</td> |
| <td>blueline</td> |
| <td>aosp_blueline-userdebug</td> |
| </tr> |
| <tr> |
| <td>Pixel 2 XL</td> |
| <td>taimen</td> |
| <td>aosp_taimen-userdebug</td> |
| </tr> |
| <tr> |
| <td>Pixel 2</td> |
| <td>walleye</td> |
| <td>aosp_walleye-userdebug</td> |
| </tr> |
| <tr> |
| <td>Pixel XL</td> |
| <td>marlin</td> |
| <td>aosp_marlin-userdebug</td> |
| </tr> |
| <tr> |
| <td>Pixel</td> |
| <td>sailfish</td> |
| <td>aosp_sailfish-userdebug</td> |
| </tr> |
| <tr> |
| <td>HiKey</td> |
| <td>hikey</td> |
| <td>hikey-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 6P</td> |
| <td>angler</td> |
| <td>aosp_angler-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 5X</td> |
| <td>bullhead</td> |
| <td>aosp_bullhead-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 6</td> |
| <td>shamu</td> |
| <td>aosp_shamu-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus Player</td> |
| <td>fugu</td> |
| <td>aosp_fugu-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 9</td> |
| <td>volantis (flounder)</td> |
| <td>aosp_flounder-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 5 (GSM/LTE)</td> |
| <td>hammerhead</td> |
| <td>aosp_hammerhead-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 7 (Wi-Fi)</td> |
| <td>razor (flo)</td> |
| <td>aosp_flo-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 7 (Mobile)</td> |
| <td>razorg (deb)</td> |
| <td>aosp_deb-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 10</td> |
| <td>mantaray (manta)</td> |
| <td>full_manta-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 4</td> |
| <td>occam (mako)</td> |
| <td>full_mako-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 7 (Wi-Fi)</td> |
| <td>nakasi (grouper)</td> |
| <td>full_grouper-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus 7 (Mobile)</td> |
| <td>nakasig (tilapia)</td> |
| <td>full_tilapia-userdebug</td> |
| </tr> |
| <tr> |
| <td>Galaxy Nexus (GSM/HSPA+)</td> |
| <td>yakju (maguro)</td> |
| <td>full_maguro-userdebug</td> |
| </tr> |
| <tr> |
| <td>Galaxy Nexus (Verizon)</td> |
| <td>mysid (toro)</td> |
| <td>aosp_toro-userdebug</td> |
| </tr> |
| <tr> |
| <td>Galaxy Nexus (Experimental)</td> |
| <td>mysidspr (toroplus)</td> |
| <td>aosp_toroplus-userdebug</td> |
| </tr> |
| <tr> |
| <td>Motorola Xoom (U.S. Wi-Fi)</td> |
| <td>wingray</td> |
| <td>full_wingray-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus S</td> |
| <td>soju (crespo)</td> |
| <td>full_crespo-userdebug</td> |
| </tr> |
| <tr> |
| <td>Nexus S 4G</td> |
| <td>sojus (crespo4g)</td> |
| <td>full_crespo4g-userdebug</td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <aside class="note"><strong>Note:</strong> Don't use Android 4.1.1 on a Nexus |
| 7 originally sold with Android 4.1.2 or higher.</aside> |
| |
| <h2 id="flashing-a-device">Flashing a device</h2> |
| |
| <p>You can flash an entire Android system in a single command; doing so verifies |
| that the system being flashed is compatible with the installed bootloader and radio, |
| writes the boot, recovery, and system partitions together, then reboots the |
| system. Flashing also erases all user data, similarly to <code>fastboot oem |
| unlock</code>.</p> |
| |
| <p>To flash a device:</p> |
| <ol> |
| <li>Place the device in <code>fastboot</code> mode by holding the appropriate |
| key combination at boot or using the following command: |
| <pre class="devsite-click-to-copy devsite-terminal">adb reboot bootloader</pre></li> |
| <li>After the device is in fastboot mode, run: |
| <pre class="devsite-click-to-copy devsite-terminal">fastboot flashall -w</pre> |
| The <code>-w</code> option wipes the <code>/data</code> partition on the |
| device; this is useful for your first time flashing a particular device but is |
| otherwise unnecessary.</li> |
| </ol> |
| |
| <aside class="note"><strong>Note:</strong> File systems created with |
| <code>fastboot</code> on Motorola Xoom don't function optimally. We recommend |
| re-creating file systems through recovery using <code>$ adb reboot |
| recovery</code>. While in recovery, open the menu (press <strong>Power + Volume Up</strong>), |
| wipe the cache partition, then wipe the data.</aside> |
| |
| <h2 id="restoring-devices-to-factory-state">Restoring devices to factory |
| state</h2> |
| |
| <p>Factory images for Google devices are available from |
| <a href="https://developers.google.com/android/nexus/images" class="external">Factory |
| Images for Nexus and Pixel Devices</a>. Factory images for the Motorola Xoom are |
| distributed directly by Motorola.</p> |
| |
| </body> |
| </html> |