Running Unit Tests from the CLI via Xcode 4

First make your test target depend on the actual app, then do this:

$ xcodebuild build -target $TARGET_NAME -configuration $BUILD_CONFIGURATION -sdk iphonesimulator SYMROOT="$TEMP_DIR"

It’ll then build and run like a normal build operation. I have not yet looked into any way to configure Test Document Data / Test Location via the CLI without resorting to scripting yet.