Summary
scaffold-ios generates an Xcode project whose app target declares a dependency on the bundled local Swift package product (<Name>Feature), but the generated project.pbxproj contains no XCLocalSwiftPackageReference. The first build fails with Missing package product.
Environment
- xcodebuildmcp 2.6.0 (brew, getsentry tap)
- 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
- Build for the simulator:
xcodebuildmcp simulator build-and-run --workspace-path /tmp/smoke/SmokeTest.xcworkspace --scheme SmokeTest --simulator-name "iPhone 17 Pro"
Expected
Build succeeds. The template's architecture (app shell + local SmokeTestPackage with a SmokeTestFeature product) is the documented intent of the scaffold.
Actual
Compiler Errors (1):
✗ Missing package product 'SmokeTestFeature' (in target 'SmokeTest' from project 'SmokeTest')
/tmp/smoke/SmokeTest.xcodeproj
❌ Build failed.
Diagnosis
The generated project.pbxproj contains:
XCSwiftPackageProductDependency objects for SmokeTestFeature without a package attribute
- no
XCLocalSwiftPackageReference section at all
packageProductDependencies on both the app and UI-test targets, but no packageReferences
The workspace (SmokeTest.xcworkspace) references SmokeTestPackage only as a group: FileRef, which does not make Xcode resolve it as a package. With no package reference, Xcode cannot resolve the product.
Fix (verified on 2.6.0)
- Add an
XCLocalSwiftPackageReference object with relativePath = SmokeTestPackage.
- Add
package = <ref-id> to each XCSwiftPackageProductDependency.
- Add
packageReferences = (<ref-id>) to each target that lists packageProductDependencies.
After this change the same build succeeds end to end (build, launch, tests).
Related
The same scaffold also generates a scheme with a dangling TestPlanReference (see the separate issue about the test plan file).
Summary
scaffold-iosgenerates an Xcode project whose app target declares a dependency on the bundled local Swift package product (<Name>Feature), but the generatedproject.pbxprojcontains noXCLocalSwiftPackageReference. The first build fails withMissing package product.Environment
Reproduction
Expected
Build succeeds. The template's architecture (app shell + local
SmokeTestPackagewith aSmokeTestFeatureproduct) is the documented intent of the scaffold.Actual
Diagnosis
The generated
project.pbxprojcontains:XCSwiftPackageProductDependencyobjects forSmokeTestFeaturewithout apackageattributeXCLocalSwiftPackageReferencesection at allpackageProductDependencieson both the app and UI-test targets, but nopackageReferencesThe workspace (
SmokeTest.xcworkspace) referencesSmokeTestPackageonly as agroup:FileRef, which does not make Xcode resolve it as a package. With no package reference, Xcode cannot resolve the product.Fix (verified on 2.6.0)
XCLocalSwiftPackageReferenceobject withrelativePath = SmokeTestPackage.package = <ref-id>to eachXCSwiftPackageProductDependency.packageReferences = (<ref-id>)to each target that listspackageProductDependencies.After this change the same build succeeds end to end (build, launch, tests).
Related
The same scaffold also generates a scheme with a dangling
TestPlanReference(see the separate issue about the test plan file).