Well, I’m writing this article based on my own recent experience while I have to upload my closed source compiled framework on CocoaPods means there is no public repo URL except one .framework file along with a license.
Below articles helped me a lot to finish uploading my closed source framework on CocoaPods.
- Getting setup with trunk -
- Private cocoapods -
- Eladnava -
Third party reference
- Telerik -
Third party reference
After going through all above articles I have still faced few issues like below
- Unexpected version directory
- Not validating
- Specification does not validate
and so on but one thing I have realized all problems are related to .podspec file only which I’m facing whenever I’m validating spec file through pod lint command i.e
pod spec lint
Let’s discuss step by step how I have created perfect working podspec file and uploaded my .framework successfully
If possible go through this article where I have explained how one could create a universal framework.
Once you have done with framework create process (
as per point 1) you have to create
MyFramework.podspecfile in your project directory.
Paste the below content inside it:
If above spec file works out for you and if it passed
pod spec lint command on your terminal then think 90% of your upload headache passed out.
.podspecvalidation I have faced validation of
.homepageparameter Error reference so anyhow instead solving it I used
--allow-warningsin pod lint validation command as below
- Now create a zip archive of your
LICENSEthrough zip command as below
- Upload your MyFramework.zip file on your server and copy the path of uploaded zip file like below which will in use for
I have used Firebase Private Hosting for .zip file upload and Dillinger for my installation documentation especially for a client where you can easily create styled HTML, pdf file using simple markdown language.
- For publishing your
.podspecfile you have to authenticate and use CocoaPods API service i.e CocoaPods Trunk
Follow below command to register yourself Reference
You can list your sessions by running
pod trunk me
- Now finally follow below last command to push your
.podspecon CocoaPods server Reference
After following all above step successfully I’m sure now you are ready to test your pod installation through any test project, Just add below line in your
.podfile and run
pod install command
You are done!!!