Summary
scaffold-ios generates a shared scheme whose <TestPlans> section references container:<Name>.xctestplan, but that file is never generated. Running tests fails with: Tests cannot be run because the test plan "<Name>" could not be read.
Environment
- xcodebuildmcp 2.6.0
- Xcode 26.4 (Build 17E192)
- macOS 26.4.1
Reproduction
- Scaffold a project:
xcodebuildmcp project-scaffolding scaffold-ios --project-name SmokeTest --output-path /tmp/smoke --bundle-identifier com.example.smoke
- (Apply the missing-package-reference fix from the other scaffold issue so the project builds.)
- Run tests:
xcodebuildmcp simulator test --workspace-path /tmp/smoke/SmokeTest.xcworkspace --scheme SmokeTest --simulator-name "iPhone 17 Pro"
Expected
Tests run. The scheme's test action should use the test plan that does exist (<Name>/<Name>.xctestplan, which is generated and contains both the package test target and the UI test target).
Actual
Errors (1):
✗ Failed to build workspace SmokeTest with scheme SmokeTest.: Tests cannot be run because the test plan "SmokeTest" could not be read.
Diagnosis
The generated scheme (<Name>.xcodeproj/xcshareddata/xcschemes/<Name>.xcscheme) contains two TestPlanReference entries:
container:<Name>.xctestplan — not generated, causes the failure
container:<Name>/<Name>.xctestplan — generated, marked default = "YES"
Xcode refuses to run the test action while any referenced plan is unreadable.
Fix (verified on 2.6.0)
Remove the dangling TestPlanReference for container:<Name>.xctestplan, keeping only the existing <Name>/<Name>.xctestplan entry. After this, the test run succeeds: 3 tests discovered and passing (2 Swift Testing package tests + 1 UI test), with a readable .xcresult.
Summary
scaffold-iosgenerates a shared scheme whose<TestPlans>section referencescontainer:<Name>.xctestplan, but that file is never generated. Running tests fails with:Tests cannot be run because the test plan "<Name>" could not be read.Environment
Reproduction
Expected
Tests run. The scheme's test action should use the test plan that does exist (
<Name>/<Name>.xctestplan, which is generated and contains both the package test target and the UI test target).Actual
Diagnosis
The generated scheme (
<Name>.xcodeproj/xcshareddata/xcschemes/<Name>.xcscheme) contains twoTestPlanReferenceentries:container:<Name>.xctestplan— not generated, causes the failurecontainer:<Name>/<Name>.xctestplan— generated, markeddefault = "YES"Xcode refuses to run the test action while any referenced plan is unreadable.
Fix (verified on 2.6.0)
Remove the dangling
TestPlanReferenceforcontainer:<Name>.xctestplan, keeping only the existing<Name>/<Name>.xctestplanentry. After this, the test run succeeds: 3 tests discovered and passing (2 Swift Testing package tests + 1 UI test), with a readable.xcresult.