How to resign a Swift ipa and preserve SwiftSupport directory structure

For the majority of our applications, we either have the source code or access to the .xcarchive file, and are able to either export the ipa from Xcode, or run the 'xcodebuild -exportArchive' to generate the signed ipa. Unfortunately, we receive one application from a vendor who is only able to provide us with an ipa file.


In the past, these builds were entirely obj-c and in order to resign, we simply replaced the embedded profile, updated the bundle id, and then ran codesign on the .app file. Where the codesign command would update entitlements, certificate, etc. to match our account's identity. Once the codesign command completed, the modified .app file was copied into a 'Payload' folder and compressed into an ipa file.


Unfortunately, the vendor just upgraded their application to Swift and the ipa they provide us now has the 'Frameworks' folder in the .app file, as well as a 'SwiftSupport' folder in the top level folder of the ipa (next to Payload). I am able to run our usual steps just fine, but have also added a step to run the codesign command on the individual libraries in the 'Frameworks' folder of the .app file. This works fine and the frameworks are resigned with our identity. However, the output of the script is an ipa with just a 'Payload' directory, no 'SwiftSupport' directory.


As expected, this fails when uploading through Application Loader to iTunes Connect, as it expects to have a 'SwiftSupport' folder. Unfortunately, if I manually copy the resigned 'Payload' and the original 'SwiftSupport' library into a zip folder and rename it to ipa, the error message from Apple still says, "Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it."


Unfortunately, since we only get the ipa from the vendor and don't have the source code ourselves, we aren't able to rebuild the app with Xcode and export the resigned ipa.


So my question is whether there is a recommended way for resigning a Swift ipa if one doesn't have the source code or initial .xcarchive? How is that SwiftSupport folder generated and added to the bundle? (outside of having to export from Xcode and select 'Save for iOS App Store Deployment')


Thanks!

Answered by DTS Engineer in 285985022

So my question is whether there is a recommended way for resigning a Swift

.ipa
if one doesn't have the source code or initial
.xcarchive
?

There may be hackish approaches that work but I want to point out that Apple does not officially support re-signing iOS apps. If I were in your shoes I’d request that the vendor supply you with an archive.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

So my question is whether there is a recommended way for resigning a Swift

.ipa
if one doesn't have the source code or initial
.xcarchive
?

There may be hackish approaches that work but I want to point out that Apple does not officially support re-signing iOS apps. If I were in your shoes I’d request that the vendor supply you with an archive.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks! I would agree. It looks like there may be methods to do the resigning. However, given that the format of an ipa will likely continue to change over time, it would seem that with each release we risk running into this same situation of having to find all places in the ipa that need to be resigned. Further proof that we should really be getting the archive.


I'll use your note above as further evidence that the vendor should provide us with an archive going forward.

Thanks again!

However, given that the format of an ipa will likely continue to change over time, it would seem that with each release we risk running into this same situation of having to find all places in the ipa that need to be resigned.

Exactly! That’s one of the reasons that Apple doesn’t support this.

I'll use your note above as further evidence that the vendor should provide us with an archive going forward.

Good luck!

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Hi @jstefanich Did you find a solution, I'm exactly going through the same problem.
How to resign a Swift ipa and preserve SwiftSupport directory structure
 
 
Q