rules_xcodeproj lets you generate native Xcode projects directly from your BazelDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/MobileNativeFoundation/rules_xcodeproj/llms.txt
Use this file to discover all available pages before exploring further.
BUILD files with a single command. The generated projects support the full range of Xcode features — indexing, debugging, runtime sanitizers, SwiftUI Previews, and more — while keeping Bazel as the source of truth for your build graph.
Installation
Add rules_xcodeproj to your Bazel workspace using Bzlmod.
Quickstart
Generate your first Xcode project in minutes with a working iOS example.
Guides
Learn focused projects, custom schemes, build modes, and more.
API Reference
Full reference for all rules, macros, providers, and aspect hints.
Why rules_xcodeproj?
rules_xcodeproj bridges the gap between Bazel’s hermetic build system and Xcode’s rich developer experience. Teams at Spotify, Lyft, Slack, Cash App, Square, and many others rely on it to maintain large-scale Apple platform codebases with Bazel.Minimal Configuration
Only the
xcodeproj rule is needed. It just works with your existing Bazel targets.Full Xcode Features
Autocomplete, debugging, sanitizers, Previews, and test running all work natively.
Focused Projects
Include only the targets you need. Unfocused targets build with Bazel automatically.
Multi-Platform
iOS, macOS, tvOS, visionOS, watchOS — all supported out of the box.
Custom Schemes
Fine-grained control over build, run, test, and profile actions in Xcode.
Cache Warming
Speed up CI and local builds with the built-in cache warming aspect.
Get started in 3 steps
Add rules_xcodeproj to your workspace
Copy the Bzlmod snippet from the latest release into your
MODULE.bazel.Define an xcodeproj target
Add an
xcodeproj target to your root BUILD file, pointing at your top-level app and test targets.Compatibility
| rules_xcodeproj | Bazel | rules_apple | rules_swift | Xcode |
|---|---|---|---|---|
| 2.13.0+ | 7.0–9.x | 4.0.0+ | 3.0.2+ | 13.3–16.x |
| 1.17.0+ | 6.3–7.x | 1.0.1–2.x | 1.x | 13.3–15.x |