Xcode does not generate DYSM for SPM dependencies

743 views Asked by At

Xcode is not generating dSYM files for my three SPM dependencies.

I have tried creating a new Swift only project and including a SPM package like CocoaLumberJack and even there I am not given a dSYM for release.

I am using Xcode 12.0.1, I have looked through all kinds of build settings with no luck to force them to be generated or find where Xcode puts them if it is generating them.

1

There are 1 answers

0
Soumya Mahunt On

Swift packages by default are treated as static library, that is why you don't see the embed options for them in Frameworks, Libraries, and Embedded Content section:

Swift static package

Static libraries don't require separate dSYM files are they don't have any executable. They are directly contained in consuming app executable so the static library symbols will be available in application's dSYM file. If you inspect you app's ipa you won't find the swift package module in Frameworks directory.

You can also make your swift package exposed product dynamic library by specifying library type as .dynamic:

.library(
    name: "SwiftLibrary",
    type: .dynamic,
    targets: ["SwiftLibrary"]
),

This will make your package module dynamic library and will allow you to choose embed option in XCode:

Swift dynamic package

If you make your package module dynamic and you can inspect your ipa to see this embedded in the Frameworks folder. After making your package module dynamic you separate dSYM file will be generated for it.