Agreed. When first I encountered these differences with xcodebuild I found it incredible that the IDE and command line builds are not based on the same backend (indeed the IDE could just wrap the command line tools if well-designed).
Every project's main build should be scriptable -- for reproducible releases, continuous integration etc. I wonder how Apple internally builds things for release when something this simple doesn't work (maybe they don't use OCUnit?).