How to build an xcframework module that is built for testing

In my current project, I have some test applications that uses my framework (<frameworkName>.framework) which is built for testing using the "build" and "test" options in xcodebuild command.

But now, I am replacing the .framework with .xcframework for which the necessary step is to archive using "xcodebuild archive" command and then create xcframework using "xcodebuild -create-xcframework" command.

I am able to build the xcframework but now wherever in the test apps, if "@testable import <ModuleName>" is used, I am getting error -

"Module <frameworkName> is not compiled for testing"

The question here is how can I create a .xcframework that is built for testing?


I have this question as well

I have the same issue.
  1. build a simple framework. Test it in a app. it works.

  2. build the xcframework for the framework.

  3. Use it in an app.

I get the following :

Umbrella header "xxFramework.h" not found
Could not build Objective-C module "xxFramework"
Failed to build module "xxFramework" from its module interface.