简体   繁体   中英

Cocoapod public distribution technique

I am very new in iOS development and I have some queries that I hope to get some assistance.

I have created an iOS framework and I have uploaded the codebase to a private git repository and released a tag. Now I created another private git repository where I'm keeping its corresponding podspec. The source defined in this podspec is the link for the iOS framework git repository.

Integrators don't have access and are not supposed to interact with the cocoapod directly. They are only supposed to interact with the SDK. The SDK does have access to the cocoapod and uses a username/password to access the private cocoapod. I want this iOS framework to be distributed publicly to integrators as an SDK, without making any of my git repositories (and the main codebase) as public. Kind of the following structure: [Integrators] -> [SDK] -> [cocoapod]

How can I achieve that?

Thanks in advance.

You can distribute a compiled framework though Cocoapods. This will allow you to keep your source code from being leaked to the Integrator. And also prevent your framework from being compiled on every clean build on the Integrator app.

By distributing compiled code we: --Keep our code secret --Save time in the app compilation process

Run the following commands:

cd ~
curl -o MyFramework.zip -L 
https://www.dropbox.com/s/5vykpag4xb5vh51/MyFramework.zip -s
unzip -q MyFramework.zip

The command above fetches the framework project. The simplest form of compiling a Swift framework is through the Xcode user interface.

open -a Xcode ~/MyFramework/MyFramework.xcodeproj

Select Generic iOS Device from device list. Lastly build the framework by selecting from menu Product > Build.

After the build process finishes you'll find the built framework in the Products folder.

To learn more about this process, you can follow this tutorial online.

Ref- https://medium.com/onfido-tech/distributing-compiled-swift-frameworks-via-cocoapods-8cb67a584d57

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM