Cocoapods static pod podspec.json add simulator

126 views
Skip to first unread message

Evolutive Apps

unread,
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:

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

 "subspecs": [
    { "name": "Core",
    "ios":
    {
    "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

unread,
Sep 24, 2020, 10:49:15 PM9/24/20
to CocoaPods
You can read the podspec documentation for https://guides.cocoapods.org/syntax/podspec.html. 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": "https://github.com/TKTestGroup/BoundleTest", "authors": {"fredevteam": "frede...@outlook.com"}, "source": {"http": "https://binaryframework.oss-cn-beijing.aliyuncs.com/BoundleTest/debug/BoundleTest-0.2.5.zip"}, "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

unread,
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
Forward
0 new messages