Using some help from the other answers here, I ended up doing the following:
Take a screenshot without the shadow (CMD+SHIFT+5, then click while holding the OPTION key).
Crop the title bar and apply the shadow using imagemagick (first installing imagemagick on mac using brew if not already installed).
$ brew install imagemagick
$ convert screenshot.png -gravity North -chop 0x94 \( +clone -background black -shadow 80x20+0+15 \) +swap -background transparent -layers merge +repage result.png
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: