| name | android-fastboot |
| description | Use for fastboot operations, flashing partitions, bootloader unlocking, recovery mode, or partition management. Triggers on "fastboot", "flash boot.img", "unlock bootloader", "recovery mode", "TWRP", "Magisk", "partition", "sideload", "A/B slots". WARNING - These operations can brick devices if done incorrectly. |
Android Fastboot Operations
⚠️ DANGER ZONE - Fastboot operations write directly to device partitions. Wrong images or interrupted operations can brick devices. Always verify:
- Correct device (check
fastboot getvar product)
- Correct images for exact device model
- Bootloader is unlocked (for flashing)
- Battery > 50%
Entering Fastboot Mode
adb reboot bootloader
Basic Commands
fastboot devices
fastboot getvar all
fastboot reboot
fastboot reboot bootloader
fastboot reboot recovery
fastboot reboot fastboot
Check Before Flashing
fastboot devices
fastboot getvar product
fastboot getvar unlocked
fastboot getvar current-slot
fastboot getvar battery-level
Bootloader Unlocking
Google Pixel
adb reboot bootloader
fastboot flashing unlock
Other Manufacturers
| Brand | Process |
|---|
| OnePlus | fastboot oem unlock |
| Xiaomi | Mi Unlock Tool (waiting period) |
| Samsung | Uses Odin, not fastboot |
| Motorola | Request code from website, fastboot oem unlock <code> |
| Sony | Request code from website |
Check Unlock Status
fastboot getvar unlocked
fastboot getvar device-state
fastboot getvar unlock_ability
Flashing Partitions
Individual Partitions
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dtbo dtbo.img
fastboot flash vbmeta vbmeta.img
fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img
Bootloader & Radio (Extra Careful!)
fastboot flash bootloader bootloader.img
fastboot reboot bootloader
fastboot flash radio radio.img
fastboot reboot bootloader
Temporary Boot (No Flash)
fastboot boot recovery.img
fastboot boot patched_boot.img
A/B Slot Devices
Modern devices have two copies of each partition (A and B).
fastboot getvar current-slot
fastboot set_active a
fastboot set_active b
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
fastboot --slot=all flash boot boot.img
Dynamic Partitions (Android 10+)
Large partitions (system, vendor, product) live inside a "super" partition.
Fastbootd Mode
fastboot reboot fastboot
fastboot getvar is-userspace
Flash Dynamic Partitions
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash product product.img
Virtual A/B Snapshots
fastboot getvar snapshot-update-status
fastboot snapshot-update cancel
Recovery Operations
Enter Recovery
adb reboot recovery
ADB Sideload
adb sideload update.zip
Flash Custom Recovery (TWRP)
fastboot boot twrp.img
fastboot flash recovery twrp.img
fastboot flash boot twrp.img
Magisk (Root)
Installation
adb pull /sdcard/Download/magisk_patched_*.img
fastboot flash boot magisk_patched_*.img
fastboot reboot
Useful Magisk Commands (after rooted)
adb shell su -c "magisk --version"
adb shell su -c "resetprop ro.debuggable 1"
Factory Reset / Wipe
fastboot erase userdata
fastboot erase cache
fastboot -w
fastboot -w flashall
fastboot -w update image.zip
Danger Levels
| Level | Operations |
|---|
| ✅ SAFE | devices, getvar, reboot, boot (temp) |
| ⚠️ MEDIUM | flash boot/recovery/dtbo, set_active |
| 🔴 HIGH | flash system/vendor, erase, -w |
| ☠️ CRITICAL | flash bootloader, flash radio, flashing lock with custom OS |
Brick Prevention
Never:
- Flash images from different device models
- Interrupt a flash operation
- Lock bootloader with custom ROM installed
- Flash bootloader/radio without matching versions
Always:
- Verify device with
fastboot getvar product
- Keep stock images available for recovery
- Use
fastboot boot to test before fastboot flash
- Maintain battery > 50%
Recovery from Soft Brick
fastboot devices
fastboot flash boot boot.img
fastboot reboot fastboot
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot -w
fastboot reboot
For hard bricks (no fastboot access), you need EDL mode (Qualcomm) or manufacturer service tools.
Quick Reference
| Task | Command |
|---|
| Check connection | fastboot devices |
| Device info | fastboot getvar all |
| Unlock bootloader | fastboot flashing unlock |
| Flash boot | fastboot flash boot boot.img |
| Test recovery | fastboot boot twrp.img |
| Current slot | fastboot getvar current-slot |
| Switch slot | fastboot set_active a |
| Wipe data | fastboot -w |
| Reboot | fastboot reboot |