Skip to main content

Documentation 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.

rules_xcodeproj lets you generate native Xcode projects directly from your Bazel 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

1

Add rules_xcodeproj to your workspace

Copy the Bzlmod snippet from the latest release into your MODULE.bazel.
2

Define an xcodeproj target

Add an xcodeproj target to your root BUILD file, pointing at your top-level app and test targets.
3

Generate the project

Run bazel run //:xcodeproj to generate the .xcodeproj file and open it in Xcode.

Compatibility

rules_xcodeprojBazelrules_applerules_swiftXcode
2.13.0+7.0–9.x4.0.0+3.0.2+13.3–16.x
1.17.0+6.3–7.x1.0.1–2.x1.x13.3–15.x
See the full compatibility table in the introduction.

Build docs developers (and LLMs) love