Flash with Fastboot  |  Android Open Source Project Skip to main content Docs What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Android Code Search / English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어 Sign in Documentation What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Docs More What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Android Code Search Overview About AOSP overview FAQ Start Try Android development Understand terminology Set up for AOSP development (9.0 or later) Set up for AOSP development (2.3 - 8.0) Download Download the Android source Troubleshoot and fix sync issues Source control tools Build Build overview Build Android Use feature launch flags Feature launch flag overview Determine flag usage and type Declare an aconfig flag Wrap code change in feature launch flag Set feature launch flag values Change a flag's value at runtime Declare and use a build flag Test code within feature launch flags Build kernels Build Pixel kernels Convert from Make to Soong Implement Java SDK library Android Rust Introduction Android Rust modules Binary modules Library modules Test modules Fuzz modules Source generators Source generators overview Bindgen bindings modules Protobuf modules Hello Rust example Android Rust patterns Rust IDE setup Compile with Jack (6.0 - 8.1) Create Source control workflow Custom device development Add a new device type Build for 32-bit and 64-bit architectures Use reference boards Create a software bill of materials (SBOM) Configure and handle update ownership for apps Test Test a build Flash with Fastboot Flash with Android Flash Tool Test with the cuttlefish emulator Use Android Emulator virtual devices Contribute Overview Android Code Search Contributor license agreements and headers Release lifecycle Submit code changes Contribute to upstream projects Git source editor Review a change Download build artifacts Report and track bugs Code with respect AOSP Java code style for contributors API guidelines Overview Android async and nonblocking API guidelines Android API client-side caching guidelines Community Code of conduct Discussion groups, contacts, and additional resources Tools, build, and related reference Overview Android.bp file format Kernel branches and their build systems Codenames, tags, and build numbers Fastboot key combinations Repo command reference What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP. AOSP Docs Getting Started Flash with Fastboot Stay organized with collections Save and categorize content based on your preferences. This page provides details for flashing Android builds onto devices using the fastboot and adb tools. Adb lets you connect your development workstation directly to your Android-powered device and perform a variety of operations. Fastboot lets you install (flash) Android and interact with the device's bootloader so you can test your OS and app changes. For additional information on how adb works, with emphasis on app development, see Android Studio's Android Debug Bridge (adb) page. If you want details on the code for adb, see the adb README. Note: Google provides an additional flash tool, called Android Flash Tool, that is intended for use only with prebuilt builds.Note: Fastboot is also the name of a bootloader module and mode. Verify that you have fastboot and adb When you build Android, adb and fastboot is built by default. To confirm the availability of adb and fastboot, run the following commands: adb --version fastboot --version If you see version numbers, you have fastboot and adb installed. If you don't see version numbers, ensure you built Android. successfully. Continue to Enable your USB connection. Enable your USB connection Before running Android on a device, you must enable your USB connection: Enable OEM unlocking and USB debugging in the developer options: In the Settings app, tap About phone. Tap Build number seven times. When you see the message You are now a developer!, tap <-. Tap System, then tap Developer options. Enable OEM unlocking and USB debugging. If OEM unlocking is unavailable, connect to the internet so the device can check in. If that still doesn't work, you can force a check in: In the Dialer app, enter *#*#CHECKIN#*#* (*#*#2432546#*#*) (no SIM required). After entering the number (no need to press call), the text disappears and a success notification appears. If OEM unlocking remains unavailable, your device might be SIM locked by your carrier and the bootloader can't be unlocked. Connect your device to a USB port on your workstation. Boot into Fastboot mode Before Android can be flashed to a device, a device must be in Fastboot mode. There are two ways to boot a device into Fastboot mode: Use the adb command: From the command-line, type adb reboot bootloader. Use a key combination: Determine the key combination for your device. For a table of Fastboot key combinations, see Fastboot key combinations. Turn the device off. Turn the device on and immediately hold down the key combination for your device (determined in step 1). Unlock the bootloader After booting into fastboot mode, you must unlock the bootloader. Warning: For privacy reasons, unlocking the bootloader deletes user data. After unlocking, all data on the device is erased, including both private app data and shared data accessible over USB (including photos and movies). To unlock the bootloader: (Optional) Back up any important files on the device. Run the unlock command for your device: If you're updating a Nexus or Pixel device that is manufactured in 2015 or later, run fastboot flashing unlock. For Pixel 2: To flash the bootloader, verify that the Pixel 2's bootloader is updated to at least Oreo MR1's version. To update to a Pixel 2 to this version, apply the over-the-air (OTA) update or sideload a full OTA. For Pixel 2 XL only with loader version prior to TMZ20a: The critical partitions might need to be unlocked before flashing. To unlock the critical partitions on Pixel 2 XL only, run fastboot flashing unlock_critical. If you're unlocking a pre-2015 device, run fastboot oem unlock. The target device displays a confirmation screen. Confirm that you want to erase all user data and unlock the device. Tip: If your device is shown in the output before reboot, but Fastboot or the flash script are misbehaving, it might be an issue with your USB cable. Try a different port or switching connectors. For example, if you're using a USB C port on your workstation try a USB A port instead. Note: On Nexus 10, after unlocking the bootloader, the internal storage remains unformatted. You can format the device using fastboot format cache followed by fastboot format userdata. Flash a device You can flash an entire Android system in a single command. Flashing an entire system with a single command verifies that the system being flashed is compatible with the installed bootloader and radio, writes the boot, recovery, and system partitions together, and reboots the system. To flash a device: Place the device in fastboot mode by holding the appropriate key combination at boot or using the following command: adb reboot bootloader After the device is in fastboot mode, run: fastboot flashall -w The -w option wipes the /data partition on the device, which is useful for your first time flashing a particular device. Note: File systems created with fastboot on Motorola Xoom don't function optimally. Google recommends that you recreate file systems through recovery using adb reboot recovery. While in recovery, open the menu (press Power + Volume Up), wipe the cache partition, then wipe the data. Re-locking the bootloader To re-lock the bootloader: For 2015 or later devices, run the command fastboot flashing lock For 2014 or earlier devices, run the command fastboot oem lock Restore device to factory state Factory images for Google devices are available from Factory Images for Nexus and Pixel Devices. Factory images for the Motorola Xoom are distributed directly by Motorola. Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. Last updated 2026-06-17 UTC. [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-17 UTC."],[],[]] Build Android repository Requirements Downloading Preview binaries Factory images Driver binaries Connect @Android on X @AndroidDev on X Android Blog Google Security Blog Platform on Google Groups Building on Google Groups Porting on Google Groups Get help Android Help Center Pixel Help Center www.android.com Google Mobile Services Stack Overflow Issue Tracker About Android Community Legal License Privacy Site feedback Manage cookies English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어