Fastboot detects phone in the fastboot mode but not when phone is on I'm trying to flash a custom recovery image with fastboot flash recovery recovery.img but it can't find the image, hence I'm powering it on and getting into location where the image is to execute the command. The problem is fastboot doesn't detect the phone when the phone is on but ADB does detect it. How can I troubleshoot this ?
Fastboot images have to be stored on the PC where you execute the fastboot command not on the device. 

Therefore the common process is:


PC: Download the image to be flashed
Boot the device into bootloader/fastboot mode
Connect the device to the PC via USB
Execute on the PC fastboot flash &lt;target_partition&gt; &lt;path to the image on the PC&gt;


Flashing firmware images that are stored as image file on the device is usually a job for a recovery ROM such as TWRP.