I just downloaded the iPhone OS 4.0 beta and have no idea what to do with the resulting ipsw file. Apple was awesome enough not to include any obvious directions. So after searching Google, I came across some forums that recommended the following:
defaults write com.apple.finder AppleShowAllFiles TRUE
That didn’t show the files that were supposed to appear at ~username/Library/iTunes/iPhone Software Updates/ and Finder looked dirty so I reran the above command using FALSE instead of TRUE.
Ultimately, I successfully installed the new iPhone OS by following the directions outlined at felixbruns.de: I pressed option-click on the Restore button in iTunes and selected iPhone1,2_4.0_8A230m_Restore.ipsw. Good times!