How to get the firmware (hex) file from a .ino file containing the code
You are asking how to locate the compiled hex file. It's easy! Follow these steps:


In the Arduino IDE select Sketch > Export Compiled Binary. This performs a compile. Once complete, this command places a copy of the compiled .hex file into the directory of your sketch.
  
Then either browse to the sketch folder or in the IDE select Sketch > Show Sketch Folder.
  


This generates two hex files for the target micro-controller; one with the bootloader and one without the bootloader. These hex files can be uploaded to the micro-controller using a programmer such as the Atmel Ice or AVRISPmkII.