I took your fresh project and reproduced the problem. There are a number of issues, and one unknown:
Build Phases of test target:
- Target Dependencies: Specify TestApp, so that the main target is always built first.
- Compile Sources: Don't include any main sources. Only include TestAppUnitTests.mm
- Link Binary With Libraries: The only one needed is SenTestingKit.framework. We can throw in Foundation and UIKit for good measure.
- Copy Bundle Resources: Should have nothing. (Later, you may want test-specific resources.)
Build Settings of test target:
- Bundle Loader should be
$(BUILT_PRODUCTS_DIR)/TestApp.app/TestApp
- Test Host should be
$(BUNDLE_LOADER)
Scheme of main target:
- Test -> Info should specify the test target
But even if I make all these changes, your project still has the odd behavior. The simulator sometimes gets a version of the app named, literally, ${PRODUCT_NAME}. Even debugging the app sometimes shows "Debug ${EXECUTABLE_NAME}" in the Log Navigator. So something else is awry, and I don't know what.
The best solution is to create a new project from scratch, specifying "Include Unit Tests". I've verified that this works.