Overview
Thetuist cache command manages binary caching to speed up build and generation times. It pre-compiles frameworks and stores them locally and remotely, allowing you to use pre-built binaries instead of compiling from source.
Usage
Subcommands
tuist cache warm
Warms the local and remote cache by building and caching frameworks.
tuist cache config
Shows the cache configuration for your project.
Options (for cache warm)
The path to the directory that contains the project whose targets will be cached.
Short form of
--path.Configuration to use for binary caching (e.g., Debug, Release).
Short form of
--configuration.If passed, the command caches only the dependencies of the targets passed in the
targets argument, not the targets themselves.Generate the project and skip warming the cache. Useful for debugging purposes.
Arguments
A list of targets to cache. Those and their dependent targets will be cached. If no target is specified, all the project targets (excluding external ones) and their dependencies will be cached.
Examples
Warm cache for all targets
Warm cache for specific targets
App and Framework targets along with their dependencies.
Cache only dependencies
App, not App itself.
Warm cache with configuration
Show cache configuration
How caching works
Tuist’s binary caching system:- Calculates a hash for each framework based on its source files and dependencies
- Checks if a pre-built binary exists in the cache (local or remote)
- If found, uses the cached binary; otherwise, builds from source
- Stores newly built binaries in the cache for future use
Cache profiles
You can configure different cache profiles in yourTuist.swift manifest:
- simulator: Cache for simulator architectures only
- device: Cache for device architectures only
- all: Cache for all architectures
- Custom profiles: Define your own caching strategy
Remote cache
To use remote caching, you need to:- Set up a Tuist account and project
- Configure your project with
fullHandleinTuist.swift - Authenticate with
tuist auth
Cache configuration
In yourTuist.swift:
upload: false for read-only mode (downloads only, no uploads).
Best practices
Cache in CI
Run
tuist cache warm in your CI pipeline to populate the remote cache.Release configuration
Cache Release builds for production deployments.
External dependencies
Use
--external-only to cache only external dependencies.Monitor cache hits
Check cache effectiveness with
tuist cache config.