How to build single flashable binary for ESP32 with esptool.py

Build of ESP-IDF project produces several files, like bootloader, application binary or partition table.

Having several files makes it harder to ship the application outside of build computer.

Solution to the problem is merging binaries into single flashable file.

Build your project with idf.py as always:

Merge binaries into single file. At the end of build process the tool will display command for flashing. This can be used to compose command like this:

Luckily there is a simpler way, because all those arguments are stored in build/flash_args file:

Example for Bash

Example for PowerShell