Xcodebuild with SwiftPM signs iOS Simulator framework but not iOS framework

Hi there, this is Riccardo, SWE @ Meta and core maintainer of React Native.

This half we are moving away from Cocoapods and we are exploring Swift PM as alternative to build React Native from source and to build a ReactNative.xcframework to distribute as a binary.

While working on my prototype, I noticed that when I run

xcodebuild -scheme "<MyScheme>" -destination "generic/platform=iOS"

The generated framework does not have the _CodeSign folder.

Instead, when I run

xcodebuild -scheme "<MyScheme>" -destination "generic/platform=iOS Simulator"

The generated framework has the _CodeSign folder properly populated.

I also created this reproducer to help you investigate the issue. You can just clone the repo and run the build.sh script.

This is the result:

How's that possible?
Am I missing something or is there in the plans to fix this?

Thanks for your help.

3 Likes