Cocoapods: Add support for dSYMs when using XCFrameworks in CocoaPods 1.9.0.beta.x

Created on 11 Feb 2020  ·  13Comments  ·  Source: CocoaPods/CocoaPods



CocoaPods 1.9.3.beta.x added support for XCFrameworks (see https://github.com/CocoaPods/CocoaPods/issues/9148 and https://github.com/CocoaPods/CocoaPods/pull/9334). However, dSYMs are not currently supported.

At PSPDFKit, we currently bundle the CocoaPods artifact as the old fat .frameworks, and we plan on distributing XCFrameworks as soon as CocoaPods supports dSYMs in its latest stable version, as dSYM support is crucial for our customers.

How the Manual Integration with dSYM supports works:

You can manually integrate XCFrameworks into your project and add the dSYMs using an .xcfilelist, as described in the second step of this guide here: https://pspdfkit.com/guides/ios/current/getting-started/integrating-pspdfkit/#integrating-the-xcframework

How to Test:

Create the Local PSPDFKit CocoaPods Artifacts:

  1. If you’re an existing customer, download PSPDFKit for iOS from the customer portal. Otherwise, if you don’t already have PSPDFKit, sign up for our 60-day trial and you will receive an email with the download instructions.
  2. Copy PSPDFKit.xcframework, PSPDFKitUI.xcframework, PSPDFKit-dSYMs, and PSPDFKitUI-dSYMs in a writable location.
  3. Remove strip-bitcode.sh and strip-framework.sh from PSPDFKit.xcframework/*/PSPDFKit.framework:
rm PSPDFKit.xcframework/*/PSPDFKit.framework/strip-*.sh
  1. Rename the PSPDFKit-dSYMs and PSPDFKitUI-dSYMs foldersto PSPDFKit.dSYMs, and PSPDFKitUI.dSYMs respectively.
  2. Create an archive (.zip file) by compressing PSPDFKit.xcframework, PSPDFKitUI.xcframework, PSPDFKit.dSYMs, and PSPDFKitUI.dSYMs into PSPDFKit.zip.
  3. Rename the resulting Archive.zip to PSPDFKit.zip.

Integrate PSPDFKit using CocoaPods Beta in a Sample Project:

  • Install CocoaPods beta on your Mac: sudo gem install cocoapods --pre. In my tests, I used 1.9.3.beta.3 in my tests
  • Download the attached sample project (CocoaPods-dSYM-Support.zip) and unzip it.
  • cd into the project directory: cd CocoaPods-dSYM-Support/SwiftExample
  • Copy the CocoaPods artifacts (PSPDFKit.zip) in the root folder (CocoaPods-dSYM-Support).
  • run pod install.
  • Open the sample project in Xcode 11.3.1: open SwiftExample/SwiftExample.xcworkspace.
  • Create an archive: In Xcode UI go to Product > Archive.
  • Inspect the dSYMs in the archive an notice that the PSPDFKit dSYMs are not present.

Screen Shot 2020-02-11 at 9 29 35 AM

Proposed Outcome:

  • dSYMs should be automatically added when using XCFrameworks, just like when using fat .frameworks.
xcframeworks confirmed defect

Most helpful comment

Will ship with final 1.9.0 release.

All 13 comments

@amorde didnt we add dSYM support for xcframeworks in 1.9.x?

Hi @radazzouz 👋

dSYM support was added by including a folder in the format FrameworkName.dSYMs, so in this case if the folders PSPDFKit.dSYMs and PSPDFKitUI.dSYMs exist, CocoaPods should pick those up and include it during the build. Did you try that and, if so, did it not work correctly?

Thanks for the prompt response, @amorde! 👍

I just tested with the dSYM folders named PSPDFKit.dSYMs, and PSPDFKitUI.dSYMs instead of PSPDFKit-dSYMs and PSPDFKitUI-dSYMs and they dSYMS are still not present in the archive.

I also updated the instructions and the sample project's Podspec from the main comment so you can conveniently test it on your side.

BTW, when using the manual integration (see the Manual-Integration-dSYM-Support.zip sample project), the dSYMs can be found in the archive on both iOS and Mac Catalyst:

| iOS | Mac Catalyst |
| --- | --- |
| Screen Shot 2020-02-11 at 1 35 20 PM | Screen Shot 2020-02-11 at 1 39 24 PM |

Hmm ok will need some time to look into this, thanks for the detailed report!

The names of the dSYMs are messing with the logic of finding the binary inside the dSYM bundle.

This is something we can fix, hopefully I'll have a PR up soon in time for 1.9. Thanks for the report!

@radazzouz I've pushed up a WIP fix for this on the amorde/xcframework-dsyms branch - if you get the chance, check it out and let me know if it works for you. I tested it against PSPDFKit and it worked for me.

Thanks @amorde! 👍

I just pulled your branch and it did not work for me. Did you use the same sample project and the updated integration steps from the main comment?

Yes I did, thanks so much for the sample + detailed instructions!

What happened when you tried my branch? did it you see "Selected dsym [path]" in the build output?

What happened when you tried my branch?

Everything worked except for the dSYMs.Just like on 1.9.0.beta.3.

BTW, I used these instructions to build locally.

did it you see "Selected dsym [path]" in the build output?

No. Unfortunately, I did not.

Looks like I had some local changes that didn't get included in that commit - I pushed again, please give it another try when you can

Thank you so much, @amorde!

I confirm that it now works on both iOS and Mac Catalyst! 🎉

| iOS | Mac Catalyst |
| --- | --- |
| Screen Shot 2020-02-13 at 7 44 56 AM | Screen Shot 2020-02-13 at 7 45 19 AM |

Will ship with final 1.9.0 release.

Was this page helpful?
0 / 5 - 0 ratings