Cocoapods static pod podspec.json add simulator

Skip to first unread message

Evolutive Apps

Sep 19, 2020, 8:37:22 AM9/19/20
to CocoaPods

I have a static pod distributed through a git and its podspec.json I cannot use xcframework because it does not seem to work, its build has an error. I have it running with iPhone devices but it does not work with the simulator. The problem is that with Xcode 12 it builds 2 separate frameworks, one with the iphoneos path and another iphonesimulator path, I have tried to include another platform but it does not work. I have this platforms and subspecs:

    { "osx": "10.11",
      "ios": "9.0",
      "ios.simulator": "9.0",
       "tvos": "10.0",
       "tvos simulator": "10.0" },

 "subspecs": [
    { "name": "Core",
    "source_files": [ "iOS/iphoneos/MyPod.framework/Headers/*.h" ],
    "public_header_files": [ "iOS/iphoneos/MyPod.framework/Headers/*.h" ],
     "vendored_frameworks": [ "iOS/iphoneos/MyPod.framework" ]
     "ios.simulator": {
       "source_files": [ "iOS/iphonesimulator/MyPod.framework/Headers/*.h" ],
       "public_header_files": [ "iOS/iphonesimulator/MyPod.framework/Headers/*.h" ],
        "vendored_frameworks": [ "iOS/iphonesimulator/MyPod.framework" ]

The thing is I think I should set the platforms to something like ios.simulator, iphonesimulator, ios simulator. But I've tried all and none works. Does anybody know a solution to this that is not using an xcframework (it has errors)? I've tried lipo to combine them but it tells me:

have the same architectures (arm64) and can't be in the same fat output file

Any help would be so much appreciated, I've searched for hours for a solution and haven't found any...

Kan Tao

Sep 24, 2020, 10:49:15 PM9/24/20
to CocoaPods
You can read the podspec documentation for and Your podspec file has been update. 
 about vendored_frameworks 

for example:
{"name": "BoundleTest", "version": "0.2.5", "summary": "A short description of BoundleTest.", "description": "TODO: Add long description of the pod here.", "homepage": "", "authors": {"fredevteam": ""}, "source": {"http": ""}, "platforms": {"ios": "8.0"}, "vendored_frameworks": "zip/BoundleTest.framework"}

If you want to use it on the simulator and iphone, you can merge the framework through `lipo`

Evolutive Apps

Oct 5, 2020, 3:00:10 PM10/5/20
to CocoaPods
Thank you, I ended up using lipo as you say.
Reply all
Reply to author
0 new messages