Changing extension name of the Framework bundle

I'm working on a suite of apps supporting macOS, iOS and iPadOS (potentially tvOS, watchOS and visionOS in the future). Each of these App targets contain minimal code to only load the framework dynamically instead of the recommended load-time imports for Apple platforms. The rationales for runtime loading of framework (using dlopen and dlsym) is expressed in earlier post - fyi.

Each app can load multiple frameworks at runtime. Instead of naming the frameworks like this - AppName_purpose1.framework, AppName_purpose2.framework, AppName_purpose3.framework, can it be named as AppName.purpose1, AppName.purpose2, AppName.purpose3 etc?
Basically, change the Framework bundle extension name from .framework to a custom name based on purpose. The folder's extension name is changed, but it's still a framework bundle.

The advantage of this approach is, in my project,

  1. Frameworks belonging to each of the apps cleanly distinguish themselves with a concise name.
  2. While this post is about Apple platforms, I'm also checking if other platforms allow to change the names of dynamic libraries (windows allows change). Using my custom extension can standardize the dynamic library's extension name across all platforms.
  3. Easy framework name construction - The Framework name is now the same as the App bundle name, which can be queried and this string can be appended with an appropriate extension to load all the Frameworks.

Is it possible to change the extension name of the Framework bundle from the default .framework? If yes, how?

Attempted to change the extension and load the Framework module, with custom extension name - .abc, at runtime and load-time using the following steps: To generate the framework with the .abc extension, Framework target -> Build Settings -> Packaging -> Wrapper Extension property is set to abc in Xcode. Then for,

Explicit loading

  1. In the path to dlopen, replace .framework extension with custom name - .abc.

Implicit linking

  1. In Framework target, named F2 (in this example), Build Settings -> Linking-General, change set LD_DYLIB_INSTALL_NAME = @rpath/F2.abc/F2
  2. In the parent target (App target) ensure that F2 is removed from Build Phases -> Link Binary With Libraries. This setting generates -framework F2 linker flag and needs to be removed. As long as this flag is present, build system always looks for .framework extension.
  3. In the parent target, in Build Settings -> Linking - General -> other linker flags, add $(BUILT_PRODUCTS_DIR)/F2.abc/F2

This setup works, though I couldn't confirm its validity in Apple documentation.

But here are other references from Apple documentation which specifically talks about how the system identifies .framework extension:

Quoting from CFBundleExecutable documentation:

For frameworks, the value of this key is required to be the same as the framework name, minus the .framework extension.

Quoting from Framework anatomy documentation:

The system identifies a framework by the .framework extension on its directory name

Can we change the extension of the Framework target (as shown above) to a custom name?

Changing extension name of the Framework bundle
 
 
Q