device batch-execute

nRF Util

tags
nRF Util

You can use the nrfutil device batch-execute command to run a sequence of device operations from a JSON batch file. This is useful when you want to repeat the same steps on a device, share a fixed workflow with others, or integrate with tools that generate batch files (for example, west flash for the nRF Connect SDK).

Most device subcommands support recording an operation into a batch file with the --append-batch option instead of running it immediately. When you append an operation, the command writes JSON to the batch file and exits without touching the device. You can run the batch later with batch-execute.

Note

  • The JSON format of batch files is not stable and can change between versions of nrfutil device.
  • Batch files created by nRF Util include an nrfutil_device_version field; batch-execute rejects files where this version does not match the installed command. Batch files without that field are still accepted, but might be incompatible.