Simple Android adb & fastboot management for Ubuntu

Desktop OS: Ubuntu 14.04, 15.04, 15.10, or Tails Linux
Device: Nexus (tested on 6 (shamu) and 9 (flounder))
Mobile OS: Android 5.1.1 > 6.0.1

Requires phone to be unlocked and USB debugging enabled in Developer options.


sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot

sudo su
adb devices
adb reboot bootloader

fastboot erase system
fastboot erase all

fastboot flash bootloader bootloader.img
fastboot reboot-bootloader
fastboot flash radio radio.img
fastboot reboot-bootloader
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot erase cache
fastboot flash cache cache.img
fastboot reboot-bootloader
fastboot oem lock
fastboot reboot

1 http://forum.xda-developers.com/nexus-6/general/guide-flash-factory-images-nexus-6shamu-t2954008

2 https://developers.google.com/android/nexus/images?hl=en