@meaton
Thanks for the quick response. I noticed your mention of a bug earlier and thought potentially this was the same issue, but wasn't sure, so thanks for confirming.
I was similarly thinking of this kind of third step - in which having allowed -exportArchive to perform the work it needs to do, unzip the resultant IPA and perform the resigning using the similar set of flags:
/usr/bin/codesign -vvv --force --sign '<identity>' --entitlements '<path to entitlements file>' --preserve-metadata=identifier,flags,runtime <path to app extracted from IPA>
Feels still a bit fragile with me not having insight into how the exact codesign invocations are generated, for example I'm not sure whether this process is any different if the .app contains app extensions, for example?
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags: