How to flash an Android Device manually

fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot flash bootloader "name of bootloader"
fastboot reboot-bootloader
fastboot flash radio "name of radio"
fastboot reboot-bootloader
fastboot -w update "name of zip file"

or 

fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash cache cache.img
fastboot erase userdata
fastboot flash userdata userdata.img
fastboot reboot

References
http://androidforums.com/threads/guide-how-to-flash-a-nexus-factory-image-manually.706533/

List of fastboot commands

fastboot
usage: fastboot [ <option> ] <command>
 
commands:
  update <filename>                        reflash device from update.zip
  flashall                                 flash boot + recovery + system
  flash <partition> [ <filename> ]         write a file to a flash partition
  erase <partition>                        erase a flash partition
  format <partition>                       format a flash partition
  getvar <variable>                        display a bootloader variable
  boot <kernel> [ <ramdisk> ]              download and boot kernel
  flash:raw boot <kernel> [ <ramdisk> ]    create bootimage and flash it
  devices                                  list all connected devices
  continue                                 continue with autoboot
  reboot                                   reboot device normally
  reboot-bootloader                        reboot device into bootloader
  help                                     show this help message
 
options:
  -w                                       erase userdata and cache (and format
                                           if supported by partition type)
  -u                                       do not first erase partition before
                                           formatting
  -s <specific device>                     specify device serial number
                                           or path to device port
  -l                                       with "devices", lists device paths
  -p <product>                             specify product name
  -c <cmdline>                             override kernel commandline
  -i <vendor id>                           specify a custom USB vendor id
  -b <base_addr>                           specify a custom kernel base address
  -n <page size>                           specify the nand page size. default:
2048
  -S <size>[K|M|G]                         automatically sparse files greater th
an
                                           size.  0 to disable
 

References
http://androidforums.com/threads/list-of-fastboot-command.714676/

Usefull ADB Commands

adb devices

adb reboot recovery

adb reboot-bootloader

adb push [source] [destination]

adb pull

adb install [source.apk]

adb install -r [source.apk] // installing while keeping the app's data, as you would on the market or with an APK (It means update )

fastboot oem unlock

fastboot devices

fastboot reboot

fastboot flash recovery

adb sideload update.zip

References
http://lifehacker.com/the-most-useful-things-you-can-do-with-adb-and-fastboot-1590337225
https://tektab.com/2015/10/31/android-bootloaderfastboot-mode-and-recovery-mode-explained/
https://stackoverflow.com/questions/8962226/testing-an-adb-update-versus-install