When you’ve downloaded a disk image for your Raspberry Pi, you need to copy it to your SD card. You can follow the simple instructions, but if you have to do this a lot it’s easier just to have a script that does it for you.
I wrote this script for use on my MacBook Air. It takes the disk image file as a parameter, e.g.
NOTE: The disk devices could be different on your computer. This script could wipe out the wrong disk if the wrong device numbers are used. I’m providing the script for convenience; please ensure you check it carefully before using it on your own computer. Take a look at the simple instructions so you can check which device numbers you need.
#!/bin/bash [[ $# -eq 0 ]] && echo "I need an image file" && exit 1 IMG=$1 echo -n "Waiting for card" df -h | grep disk2s1 RES=$? while [[ $RES -gt 0 ]] ; do echo -n . sleep 1 df -h | grep disk2s1 > /dev/null RES=$? done echo echo "Disk found" echo "Unmounting..." diskutil unmount /dev/disk2s1 echo "Copying (please wait)..." dd bs=1m if=$1 of=/dev/rdisk2 echo "Ejecting..." diskutil eject /dev/rdisk2 echo "Done. Remove card."