Xcode (Cloud) vs. Playground App

Hej hej

tl;dr. I have problems building a Playground App using Xcode Cloud and I created a reference repository to reproduce this. Did anyone try this before and succeeded? Maybe you have a hint about what's going wrong here.

Initial Failure

I followed the documentation for Building Swift packages and Swift Playgrounds app projects with Xcode Cloud and I have always run into the following error message:

❌ Code Signing
Exporting for App Store Distribution failed. Please download the logs artifact for more information

Check Logs

“Fair game!” I thought, checked out the logs and see this error appearing twice in each of the following steps:

  • Export archive for ad-hoc distribution
  • Export archive for development distribution
  • Export archive for app-store distribution
5.3 Sec.
Run command: 'xcodebuild -exportArchive -archivePath /Volumes/workspace/tmp/3546d064-74fa-42d0-8b36-3623e18941be.xcarchive -exportPath /Volumes/workspace/adhocexport -exportOptionsPlist /Volumes/workspace/ci/ad-hoc-exportoptions.plist '-DVTPortalRequest.Endpoint=http://172.16.35.199:8089' -DVTProvisioningIsManaged=YES -IDEDistributionLogDirectory=/Volumes/workspace/tmp/ad-hoc-export-archive-logs -DVTSkipCertificateValidityCheck=YES -DVTServicesLogLevel=3'
Error
Command exited with non-zero exit-code: 70

Moving forward, I downloaded the logs artifact as suggested earlier. This is IDEDistribution.standard.log:

2024-10-27 11:15:04 +0000 [MT] Starting export with options: {"embedOnDemandResourcesAssetPacksInBundle":true,"teamID":"38R2LLP8AF","stripSwiftSymbols":true,"thinning":"<none>","iCloudContainerEnvironment":"Development","destination":"export","reformatterBundleIdentifier":"hamburg.plus.encore","uploadSymbols":true,"raiseProfileSupportOptionalToRequired":false,"buildNumber":"4","testFlightInternalTestingOnly":false,"manageAppVersionAndBuildNumber":false,"method":"ad-hoc","generateAppStoreInformation":false}

This is IDEDistribution.critical.log (actually it's three times this single error, but I'll spare you the repetition):

2024-10-27 11:15:04 +0000 [MT] -[IDEDistributionMethodManager orderedDistributionMethodsForTask:archive:logAspect:]: Error = Error Domain=IDEDistributionMethodManagerErrorDomain Code=2 "Unknown Distribution Error" UserInfo={NSLocalizedDescription=Unknown Distribution Error}

And this is an excerpt (of hopefully relevant details) of IDEDistribution.verbose.log (again, this happens three times, only giving the relevant data points here):

…
2024-10-27 11:15:04 +0000 [MT] Rejected distribution method <IDEDistributionMethodiOSAdHoc: 0x600001590100> because it doesn't support distributing archive
…
2024-10-27 11:15:04 +0000 [MT] Rejected distribution method <IDEDistributionMethodiOSAppStoreValidation: 0x6000015900f0> because it doesn't support distributing archive
…
2024-10-27 11:15:04 +0000 [MT] Rejected distribution method <IDEDistributionMethodiOSAppStoreDistribution: 0x600001590120> because it doesn't support distributing archive
…
2024-10-27 11:15:04 +0000 [MT] Rejected distribution method <IDEDistributionMethodiOSAdHoc: 0x600001590100> because it doesn't support distributing archive
…
2024-10-27 11:15:04 +0000 [MT] Available distribution methods: {(
    <IDEDistributionMethodSaveBuiltProducts: 0x6000015f8060>,
    <IDEDistributionMethodExportArchive: 0x6000015f8070>
)}

Investigate Xcode Archive (*.xcarchive)

At this point, I downloaded the Xcode archive from AppStoreConnect and realized that it only contained debug symbols for the app, but not the app itself.

> ls -la /Users/herzi/Downloads/….xcarchive/Products
total 0
drwxrwxr-x@ 2 herzi  staff   64 27 Okt 12:21 .
drwxrwxr-x@ 5 herzi  staff  160 27 Okt 12:22 ..

Notice the absence of the Applications folder that would contain the Application.app bundle.

Current Status

So I created a clean, sample repository for my integration. Did anyone try this before and succeeded? Maybe you have a hint about what's going wrong here.

From Requirements for using Xcode Cloud > Project and workspace requirements:

-exportOptionsPlist /Volumes/workspace/ci/ad-hoc-exportoptions.plist

When you use automatic code signing, the signing style field is set to automatic in the exportoptions.plist file.

Xcode (Cloud) vs. Playground App
 
 
Q