LinuxCommandLibrary

carthage

decentralized dependency manager for Cocoa projects

TLDR

Update and build dependencies

$ carthage update
copy
Build XCFrameworks
$ carthage update --use-xcframeworks
copy
Bootstrap without updating
$ carthage bootstrap
copy
Build specific dependency
$ carthage build [dependency_name]
copy
Update without building
$ carthage update --no-build
copy
Build for specific platform
$ carthage update --platform [iOS]
copy
Check outdated dependencies
$ carthage outdated
copy

SYNOPSIS

carthage command [options]

DESCRIPTION

carthage is a decentralized dependency manager for Swift and Objective-C Cocoa projects. Unlike CocoaPods, it builds dependencies as binary frameworks without modifying your Xcode project files, workspace, or build settings, leaving full control of the project structure to the developer.
Dependencies are declared in a Cartfile using a simple syntax that supports GitHub repositories, Git URLs, and binary-only frameworks. Running `carthage update` resolves versions, checks out sources, and builds frameworks into the Carthage/Build directory. A Cartfile.resolved lockfile ensures reproducible builds across team members.
Since version 0.37.0, Carthage supports building XCFrameworks, which bundle binaries for multiple platforms and architectures into a single distributable package.

PARAMETERS

--use-xcframeworks

Build as XCFrameworks (recommended)
--platform name
Build for specific platform (iOS, macOS, tvOS, watchOS)
--no-build
Skip building after checkout
--no-use-binaries
Build from source, don't use prebuilt binaries
--cache-builds
Cache built frameworks
--project-directory path
Directory containing Cartfile
--verbose
Show detailed output

CONFIGURATION

Cartfile

Declares project dependencies with version constraints.
Cartfile.resolved
Lockfile with exact resolved versions for reproducible builds.
Cartfile.private
Dependencies needed only for development and testing.

COMMANDS

update

Update and rebuild dependencies
bootstrap
Build dependencies without updating
build
Build specific dependency
outdated
Check for outdated dependencies
archive
Create archive of built frameworks
copy-frameworks
Copy frameworks to app bundle
version
Show version

CARTFILE FORMAT

$ github "Alamofire/Alamofire" ~> 5.0
github "realm/realm-swift" == 10.0.0
git "https://example.com/repo.git" "branch-name"
copy

CAVEATS

Supports dynamic frameworks on iOS 8+. Static framework support since version 0.30.0. Consider Swift Package Manager for new projects. Frameworks go to Carthage/Build directory.

SEE ALSO

swift(1), xcodebuild(1), pod(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community