I am working on an iOS project. I am using a framework (UnityFramework) that only works on device and not on the simulator. I want to exclude the framework when running on simulator for ease of testing, as the app will not compile otherwise.
I have followed the instructions from this StackOverflow post (which seems to be out of date) and this Apple documentation to weakly link the framework so that it is not included when building for simulator, but I still get the same error when building for simulator: framework not found.
I am not sure if I am missing something I need to exclude this framework from simulator builds, or if something is wrong with my configuration. I have tried using both -weak_framework and -ObjC -weak_framework in "Other Linker Flags." I am using Xcode 13.3.
My build settings:
Frameworks, Libraries, and Embedded Content: UnityFramework.framework - Embed & Sign
Build Settings - Other Linker Flags - All marked with -weak_framework UnityFramework
Build Phases - Link Binary with Libraries - UnityFramework.framework - Optional
Here is a snippet of the error I get:
Ld .../Library/Developer/Xcode/DerivedData/app-gygzddvoumbadmatpojfllhgdkag/Build/Products/Debug-iphonesimulator/AppDevelopment.app/AppDevelopment normal (in target 'AppDevelopment' from project 'App') cd .../projects/app-folder
-Xlinker .../Library/Developer/Xcode/DerivedData/app-gygzddvoumbadmatpojfllhgdkag/Build/Intermediates.noindex/app.build/Debug-iphonesimulator/appDevelopment.build/Objects-normal/x86_64/appDevelopment.swiftmodule -weak_framework UnityFramework -Xlinker -sectcreate -Xlinker __TEXT -Xlinker
ld: framework not found UnityFramework