Search code examples
iosxcodecocoapodsdependency-managementiphone-privateapi

Link Private Apple Framework with CocoaPods


Disclaimer: I am working on a library that is linked to a Non-App Store project via CocoaPods. The library uses private API's for multiple functionalities. I'm just asking for a technical solution.

I am working on a library that is redistributed using CocoaPods. In the core project of the library I am linking it with one of the private frameworks shipped with Xcode. The exact location of the framework is:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/PrivateFrameworks

I would like to avoid copying this framework into the library to be linked as "CocoaPods Private Framework" and rather link it directly according to the iOS SDK choosen in the Xcode project or Podfile.

So my question is:

Does CocoaPods support linking against Apple's private frameworks shipped with Xcode? If yes, what is the correct syntax to specify the framework in .podspec file?

I have not been able to find any exact information about this on the web, only for linking specific frameworks.

Thanks.


Solution

  • Quite some time passed, but since I was looking for the same thing and ended up here there might be other hits, too. So, the answer is adding the following to your spec file:

      s.xcconfig     =  { "FRAMEWORK_SEARCH_PATHS" => "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks" }