ADB Commands - These only work when device is booted

  • adb devices - shows all connected adb devices
  • adb shell - launches a shell on the device
  • adb shell pm list packages - list all installed packages on the device
  • adb shell pm list packages -3"|cut -f 2 -d ": - lists all user installed packages
  • adb push <local> <remote> - pushes the file to
  • adb pull <remote> [<local>] - pulls the file to . If isn’t specified, it will pull to the current folder.
  • adb logcat - allows you to view the device log in real-time. You can use adb logcat -b radio to view radio logs, and adb logcat -C to view logs in colour
  • adb install <file> - installs the given .apk file to your device
  • adb uninstall com.packagename - uninstalls package from shell pm list packages
  • Note: if you encounter “[DELETE_FAILED_INTERNAL_ERROR]” type this to bypass: adb shell pm uninstall --user 0 <appname>
  • adb reboot - reboots system
  • adb reboot bootloader - reboots to bootloader
  • adb reboot recovery - reboots into recovery mode
  • adb reboot fastboot - reboots into fastboot mode

Fastboot Commands - These commands work when device is in Bootloader and Fastboot Mode

  • fastboot devices - shows all connected devices
  • fastboot reboot - reboots device - can add bootloader, recovery, and fastboot
  • fastboot oem device-info - shows oem bootloader status (unlocked or locked)
  • fastboot oem unlock - unlocks oem phones - note: aosp and unlocked phones don’t need this
  • fastboot flashing unlock - unlocks system for custom rom in pixel and other phones
  • fastboot flashing unlock_critical - unlocks bootloader and system partitions - note: this isn’t generally needed
  • fastboot format:ext4 userdata - format userdata on device - note: this will erase your entire device
  • fastboot boot recovery.img - test recovery image without flashing
  • fastboot flash recovery recovery.img - flash recovery image then run fastboot reboot recovery to boot into it.
  • fastboot flash boot boot.img - flash boot image - this is the kernel
  • fastboot -w - wipes device
  • fastboot update </path/to/your/> - flashes zip to the device

实战 - 给一加刷LineageOS 17

Instructions :

Download the latest build

$ adb reboot bootloader
$ fastboot -w (this will wipe your data)
$ fastboot flash recovery recovery.img
$ fastboot reboot fastboot
$ fastboot erase scratch
$ fastboot flash boot boot.img
$ fastboot flash dtbo dtbo.img
$ fastboot flash system system.img
$ fastboot flash product product.img
$ fastboot flash vbmeta vbmeta.img
$ fastboot flash vbmeta_system vbmeta_system.img
$ fastboot reboot
Last modification:September 20th, 2020 at 04:09 pm