fozu
on
Mar 21, 20232023-03-21T00:00:00+08:00
Updated
Jun 92024-06-09T20:42:03+08:00
2 min read
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
trunk url
1
2
| source 'https://github.com/CocoaPods/Specs.git'
source 'https://cdn.cocoapods.org/'
|
Q & A
1
| s.pod_target_xcconfig = { "SWIFT_ACTIVE_COMPILATION_CONDITIONS" => "SPPERMISSIONS_CAMERA SECOND_FLAG" }
|
1
2
3
| s.pod_target_xcconfig = {
'OTHER_SWIFT_FLAGS[config=Debug]' => '-DDEBUG',
}
|
1
| --skip-import-validation
|