howto codesign and package for testflight

Hi,

I have create a universal app then did this:

https://support.apple.com/en-vn/guide/apple-business-essentials/axm20c32e0c6/web

But this doesn't produce a working package installer.

productbuild --sign "3rd Party Mac Developer Installer: ****" --component /Applications/MyApp.app MyApp-universal.pkg

Do I need to create a code signature with codesign, prior to call productbuild?

regards, Joël

Replies

I think it is necessary to sign first the binary, because else App sandbox won't work. So first:

codesign --entitlements /Applications/MyApp.app/Contents/MyApp.entitlements -s "Apple Distribution: ****" /Applications/MyAppapp

I checked the installer package in a VM. It works with sandbox.

After this I validated the package successful.

xcrun altool --validate-app -f ****-universal.pkg -t osx -u ****

And upload succeeds.

xcrun altool --upload-app -f MyApp-universal.pkg -t osx -u ****