fx flash-remote

Remotely build, fetch and flash a Fuchsia image onto a device, see https://fuchsia.dev/fuchsia-src/development/sdk/ffx/flash-a-device

usage: fx flash-remote HOST [DIR] [--no-flash] [--no-build]

Connect to HOST, run a build using fx from DIR, fetch the artifacts and
start the flash.

 --no-build                Do not build, just pull artifacts already present
 --no-flash                Do not start the fastboot, just pull the artifacts
  -s                       Serial of device you wish to flash to (only necessary if multiple
                           devices in fastboot mode)
 --skip-verify             Skip hardware verification. This is dangerous, please be
                           sure the images you are flashing match the device. Only supported
                           with ffx
 --no-bootloader-reboot    Don't reboot bootloader after flashing firmware or
                           recovery fastboot image.

 HOST          the hostname to connect to
 DIR           defaults to ~/fuchsia, the path to the FUCHSIA_DIR on HOST

flash-remote source code