0

I am working on an iOS framework that requires OpenSSL for certain functionalities. To keep the framework’s size minimal, I included only the iphoneos version of OpenSSL by compiling it specifically for iOS devices and dragging it into my framework.

However, when I integrate this framework into a project and try to run it on the simulator, I get build errors because the simulator architecture (iphonesimulator) is missing.

My Questions:

  1. Is there a way to avoid these issues without including the iphonesimulator version of OpenSSL in my framework?
  2. If not, do I need to create a universal framework or xcframework that includes both iphoneos and iphonesimulator builds of OpenSSL?
  3. If I must create a universal framework or xcframework, what is the correct way to achieve this?

Additional Context:

  • The primary goal is to keep the framework size as small as possible.
  • The framework must work seamlessly on both physical devices and simulators during development.
  • OpenSSL is used only within the framework and not exposed externally.

Any guidance on achieving this would be highly appreciated. If creating a universal framework or xcframework is the best solution, an example script or detailed steps would be extremely helpful.

Thank you!

3
  • Have you tried using CommonCrypto instead of OpenSSL? It's already built into iOS and Apple recommends to use it instead of OpenSSL. Commented Dec 3, 2024 at 14:41
  • Actually, I am using a library with a significant dependency on OpenSSL. Refactoring it to use CommonCrypto would take a considerable amount of time right now. However, I will still consider this option. Commented Dec 3, 2024 at 18:44
  • 1
    If you want to focus on framework size only, try to integrate it as a static library first, then only the required symbols will be copied into your main executable file, the full version of framework is unnecessary. Commented Dec 4, 2024 at 5:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.