Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 6, 2026·3 min de lectura

Carthage — Decentralized Dependency Manager for Cocoa

A simple dependency manager for macOS and iOS that builds frameworks without altering your Xcode project structure.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Carthage Overview
Comando de instalación directa
npx -y tokrepo@latest install 47df858d-7959-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Carthage takes a deliberately minimal approach to dependency management for Apple platforms. Unlike centralized package managers, it fetches source code from Git repositories, builds frameworks, and leaves your Xcode project files untouched. You stay in control of your build settings.

What Carthage Does

  • Resolves and fetches dependencies declared in a simple Cartfile
  • Builds each dependency into pre-compiled XCFrameworks
  • Produces a Cartfile.resolved lock file for reproducible builds
  • Supports GitHub, GitLab, and any arbitrary Git URL as sources
  • Works alongside Swift Package Manager and CocoaPods without conflicts

Architecture Overview

Carthage reads your Cartfile, resolves the dependency graph using semantic versioning constraints, then checks out each repository at the resolved version. It invokes xcodebuild to compile each dependency into an XCFramework. The resulting binaries go into Carthage/Build, and you link them manually, keeping your .xcodeproj clean of third-party build phases.

Self-Hosting & Configuration

  • Install via Homebrew: brew install carthage
  • Create a Cartfile listing each dependency (GitHub shorthand or full Git URLs)
  • Run carthage update --use-xcframeworks to build
  • Link the generated XCFrameworks in Xcode under Frameworks, Libraries, and Embedded Content
  • Use carthage bootstrap in CI for reproducible builds from the lock file

Key Features

  • Zero modification to your .xcodeproj or workspace
  • Builds XCFrameworks that work across iOS, macOS, tvOS, watchOS, and visionOS
  • Supports binary caching to skip rebuilding unchanged dependencies
  • Decentralized model with no central registry required
  • Cartfile syntax is intentionally simple and human-readable

Comparison with Similar Tools

  • Swift Package Manager — Apple-official and integrated into Xcode; less flexible with non-Swift dependencies
  • CocoaPods — centralized spec repo with richer plugin ecosystem; modifies your Xcode workspace
  • Mint — focuses on Swift CLI tool installation, not framework dependency management
  • Accio — SPM-based but builds XCFrameworks like Carthage; smaller community
  • Tuist — project generation tool that can also manage dependencies; broader scope

FAQ

Q: Does Carthage support Swift Package Manager packages? A: Not directly. Carthage resolves from Git repos with Xcode projects. If a library only provides a Package.swift, use SPM instead.

Q: How do I speed up Carthage builds in CI? A: Cache the Carthage/Build directory between runs, and use carthage bootstrap instead of carthage update to respect the lock file.

Q: Is Carthage still actively maintained? A: The project receives community maintenance and is compatible with current Xcode and Swift releases.

Q: Can I use Carthage and CocoaPods in the same project? A: Yes. Carthage manages its own build output directory and does not interfere with CocoaPods' Pods workspace integration.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados