Apple has steps to create a bootable USB (linked below), but not an ISO file.
There are also several methods to create an ISO, such as colt2’s method linked below.
The steps in this guide are what I found to be the most straight forward compared to other guides. These are performed on an OS X system to create a bootable ISO which can then be imaged to USB or used directly for installing on virtual machines.
Note – the ISO created from this method does not work when burned to DVD. The resulting disk is bootable, but when trying to install the operating system you will receive the error:
The Install OS X El Capitan application can’t be used from this disk. Copy this application to a writable Mac OS Extended formatted disk and reopen it to continue installation.
The steps presented below can be used for other versions of OS X by increasing the size of the image as necessary and adjusting the name of the files appropriately (from El Capitan).
- Download El Capitan installer from Apple
- Install it
- Create a blank image file in the temp folder, overwriting any existing file that may exist
hdiutil create -ov /tmp/ElCapitan -size 7316m -layout SPUD -fs HFS+J
- Mount the blank image to a temporary mount point
hdiutil attach /tmp/ElCapitan.dmg -noverify -nobrowse -mountpoint /Volumes/my_bootdisk
- Write the installation files to the image (this step requires administrator privileges)
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/my_bootdisk --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app
- Unmount the new image
hdiutil detach /Volumes/Install\ OS\ X\ El\ Capitan
- Convert the new image to an ISO file
hdiutil convert /tmp/ElCapitan.dmg -format UDTO -o /tmp/ElCapitan
- Move the file from the tmp folder to the Desktop of the logged in user and also change extension to ISO
mv /tmp/ElCapitan.cdr ~/Desktop/ElCapitan.iso
- Delete the original image file
The resulting ISO file is now ready to use.