This is, unfortunately, not properly supported. There are a few hacks to get this to work, including the one mentioned here:
The solution recommended here, however, is to modify a system script, which is not something I usually like to do.
Instead here are the steps I followed:
Then run this in Terminal:
xcodebuild -workspace MyWorkspace.xcworkspace -sdk iphonesimulator TEST_AFTER_BUILD=YES clean build
If you get an error about "No active architectures", then you can add
Once this works, you can use the gist linked above.