Reputation: 2132
I have an issue: I have built-in frameworks via "Frameworks, Libraries, and Embedded Content" that work only on real devices, while their source code is not available and I can't create version for simulator. However, I need to run the project on the simulator, and the functionality that is associated with the frameworks is disabled for the simulator with:
#if targetEnvironment(simulator)
#else
import MyFramework
import MyFramework1
#endif
However, when we try to start the project in simulator mode, I get an error -
Building for iOS Simulator, but the linked and embedded framework 'Framework' was built for iOS.
At Build Phases -> Link Binary With Libraries for my target I selected optional
status for MyFramework and MyFramework1
Any suggestion how to fix run for simulator without these frameworks are welcome!
Upvotes: 2
Views: 225
Reputation: 2132
I've found useful fix for my case. This fix is based on this. I just excluded the folder for the simulator (Any iOS Simulator SDK) where the frameworks are physically located. I've added path like this "$(SRCROOT)/my_project/my_libs/*"
Upvotes: 1