Write an img file to an SD card in macOS

This is not a complex thing but the terminal window can be daunting and the commands aren’t exactly memorable. Even so, it’s just three commands. so…

Open a terminal window

  1. Get a list of attached disks
diskutil list

Identify the SD card disk ID (not the partition).  You will be using that wherever I use “diskNN

  1. Unmount the SD card
diskutil unmountDisk /dev/diskNN
  1. Write the image to the SD card
sudo dd bs=1m if=/path/to/image.img of=/dev/diskNN

You will be asked for your password and then it will appear to do nothing for quite a while, eventually it will finish and report the number of blocks written.