Home cocoapods
Post
Cancel

cocoapods

CocoaPods Trunk

CocoaPods Trunk is an authentication and CocoaPods API service. To publish new or updated libraries to CocoaPods for public release you will need to be registered with Trunk and have a valid Trunk session on your current device. You can read about Trunk’s history and development on the blog, and about private pods for yourself or your team.

A collection of commands under pod trunk automate the deployment and management of your Podspecs. At any time you can run pod trunk [command] --help to see inline help.

1
pod trunk [command] --help

register

1
2
3
4
5
6
# This begins a session on your current device.
pod trunk register example.email@cocoapods.org 'Orta Therox' --description='macbook air'
pod trunk register freyzoulee@gmail.com 'fozu' --description='sl-mbp'

# list your session
pod trunk me

Trunk accounts do not have passwords, only per-computer session tokens.

Deploy a library

pod trunk push [NAME.podspec] will deploy your Podspec to Trunk and make it publicly available. You can also deploy Podspecs to your own private specs repo with pod repo push REPO [NAME.podspec].

1
2
3
4
5
# deploy your Podspec to Trunk and make it publicly available
pod trunk push [Name.podspec]

# deploy Podspecs to your own private specs repo 
pod repo push REPO [NAME.podspec].

lint your spec

1
2
# Lints your Podspec locally. You can lint at any time with pod spec lint [NAME.podspec]
pod spec lint [NAME.podspec]
  • A successful lint pushes your Podspec to Trunk or your private specs repo
  • Trunk will publish a canonical JSON representation of your Podspec
  • Trunk will also post a web hook to other services alerting them of a new CocoaPod,

Private Pods

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Add your Private Spec Repo to your CocoaPods installation
pod repo add REPO_NAME SOURCE_URL

# Check if your installation is successful and ready to go.
cd ~/.cocoapods/repos/REPO_NAME
pod repo lint .

# Add your Pod's Podspec to your repo
pod repo push REPO_NAME SPEC_NAME.podspec --allow-warnings --verbose --sources='xxx, yyy'

# update a repo
pod repo update sl-trunk

# Remove a private repo
pod repo remove [name]

References

https://guides.cocoapods.org/making/getting-setup-with-trunk.html

Notes

Сocoapods trunk URL couldn’t be downloaded

trunk url

1
2
source 'https://github.com/CocoaPods/Specs.git'
source 'https://cdn.cocoapods.org/'

Q & A

How add to pod_target_xcconfig more flags?

1
s.pod_target_xcconfig = { "SWIFT_ACTIVE_COMPILATION_CONDITIONS"  => "SPPERMISSIONS_CAMERA SECOND_FLAG" } 

Preprocesor flag on Cocoapod podspec

1
2
3
s.pod_target_xcconfig = {
  'OTHER_SWIFT_FLAGS[config=Debug]' => '-DDEBUG',
}

CocoaPods podspec push without build simulator architecture

1
--skip-import-validation
This post is licensed under CC BY 4.0 by the author.