I want to distribute mac app to our testers.
According to Apple: Test a beta version
Export the app using a development provisioning profile
How do you do this via xcodebuild/ xcrun or fastlane?
I tried:
build_app(
catalyst_platform: 'macos',
configuration: "Development",
destination: "generic/platform=macOS,variant=Mac Catalyst",
scheme: "MyScheme",
export_options: {
compileBitcode: false,
installerSigningCertificate: "3rd Party Mac Developer Installer: MY COMPANY (12345ABCDE)",
method: "development",
provisioningProfiles: provisioningProfiles,
signingCertificate: "Apple Development"
}
)
Which will generate command:
xcodebuild -scheme MyScheme -configuration Development -destination 'generic/platform=macOS,variant=Mac Catalyst'
However, during export, I get
PKG invalid
If I only use the .app file, I'm getting

I also tried
xcodebuild archive -archivePath "AppDevelopment.xcarchive" -scheme "Development" -configuration Development -destination 'generic/platform=macOS,variant=Mac Catalyst'
xcodebuild archive -archivePath "AppDevelopment.xcarchive" -scheme "Development" CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO -configuration Development -destination 'generic/platform=macOS,variant=Mac Catalyst'
Same result