shipping-swift-apps
Shipping Swift Apps to TestFlight
Distribution fails differently from building. The compiler is happy, the archive succeeds, and then App Store Connect rejects the upload for a reason that has nothing to do with your code — a version train that closed when the last release was approved, a build number someone already used, a helper target that made the archive undistributable. Every trap below comes from an upload that was rejected after a clean build.
For build- and CI-side problems (unsigned builds, the hand-maintained pbxproj,
test-target boundaries), see the building-swift-apps skill. This skill starts
at the archive.
fastlane owns metadata; xcodebuild owns the binary
The reflex is to hand fastlane the whole release with gym + pilot. You don't
have to, and there's a good reason not to: xcodebuild already uploads, so
fastlane's build wrapper is one more layer between you and the signing error.