The debug build settings that decide how long you wait

Eight build settings decide how much work every debug build does. What each one does, the value it should have, where to find it, and a free script that checks all your targets at once.

A handful of build settings decide how much work every debug build does, and in a project that’s a few years old, at least one of them is often wrong in at least one target. For the builds you make all day you want incremental compilation, no optimization, debug information without a dSYM file, the active architecture only, and script phases that declare their inputs and outputs. Beyond that, keep the settings that shape modules the same across targets, and skip index data in command-line builds. Here’s what each setting does, where to find it, how a wrong value creeps in, and how to check every target at once.

Right valuesCompile 1 fileLink
Compilation Mode: Whole ModuleCompile every file in the moduleLink
Build Active Architecture Only: NoCompile 1 fileLinkCompile it againLink again
Debug Information Format: DWARF with dSYM FileCompile 1 fileLinkGenerate dSYM
A script phase without outputsRun scriptCompile 1 fileLink
The same one-line change, built with each wrong value. Highlighted: the extra work it adds. A sketch, not to scale.

The short version

Setting, as the Build Settings tab shows it Debug value Why
Compilation Mode SWIFT_COMPILATION_MODE Incremental singlefile Whole Module recompiles the whole module after any change
Optimization Level, Swift SWIFT_OPTIMIZATION_LEVEL No optimization -Onone The optimizer adds compile time to every build
Optimization Level, C and Objective-C GCC_OPTIMIZATION_LEVEL No optimization 0 The same, for C and Objective-C
Debug Information Format DEBUG_INFORMATION_FORMAT DWARF dwarf A dSYM adds a step after every link
Build Active Architecture Only ONLY_ACTIVE_ARCH Yes YES Otherwise every architecture is compiled
Input and output files of each Run Script phase Build Phases tab Declared Otherwise the script runs on every build
User Script Sandboxing ENABLE_USER_SCRIPT_SANDBOXING Yes YES Catches scripts that use files they didn’t declare
Preprocessor Macros, C Language Dialect GCC_PREPROCESSOR_DEFINITIONS GCC_C_LANGUAGE_STANDARD The same in every target Each different value can build the same modules again
Enable Index-While-Building Functionality COMPILER_INDEX_STORE_ENABLE Off for command-line builds only NO Nobody reads index data in CI or agent builds
Eager Linking EAGER_LINKING Try Yes YES Swift-only dynamic frameworks unblock linking sooner

Check yours in one command

The free check_settings.py script checks every target in your project, or in each project of your workspace, CocoaPods’ included. It prints every setting above with how many targets have each value, then what to change, why, and a link to the section below that explains it. It only reads the settings and the project files: it builds nothing and changes nothing.

git clone https://github.com/quickfirehq/faster-builds.git
cd path/to/your/app
python3 path/to/faster-builds/scripts/check_settings.py

What it prints looks like this (shortened):

MyApp.xcworkspace, Debug configuration: 25 targets in 2 projects

Current values (value: number of targets):
  Compilation Mode                  SWIFT_COMPILATION_MODE      singlefile: 24, wholemodule: 1
  Debug Information Format          DEBUG_INFORMATION_FORMAT    dwarf: 24, dwarf-with-dsym: 1
  ...

To change (each one slows every build):
  1. Compilation Mode (SWIFT_COMPILATION_MODE) is wholemodule in Networking.
     Set it to Incremental (singlefile). Whole Module recompiles every Swift file in the module ...
     More: https://quickfirebuild.com/blog/debug-build-settings/#1-compilation-mode

Script phases that run on every build:
  Pods/SomePod > [CP-User] Generate: it declares no output files.

Hand it to your coding agent

With its JSON option, the script prints the same report for scripts and agents: each finding’s key, current value, recommended value, targets and reason. To have an agent check the project and make the changes, give it this:

Read https://quickfirebuild.com/blog/debug-build-settings/. Then, from the project folder, clone https://github.com/quickfirehq/faster-builds and run `python3 faster-builds/scripts/check_settings.py --json`.

For each finding, tell me the setting, the targets, the current and recommended value, and why, and wait for my go-ahead.

Then change only the Debug configuration: in the .xcconfig file if the project sets that setting there, otherwise in the target's build settings in project.pbxproj. For CocoaPods targets, change the Podfile's post_install hook instead of the Pods project, which `pod install` regenerates. Don't touch Release.

Time the same build before and after with faster-builds/scripts/time-build.sh, and tell me what changed.

Find a setting by hand

Select your project in the navigator, select a target, and open the Build Settings tab. Choose All (not Basic) and Levels, then type the setting’s name or its key into the search field: both work. Levels shows where the value comes from:

  1. Default
  2. Project's .xcconfig
  3. Project
  4. Target's .xcconfig
  5. Target
Each layer overrides the ones before it, and the last one that sets a value wins. In the Levels view the winning value is in the first column, and a target that sets its own value hides the project's.

That’s how one target ends up different: the project says Incremental, but a value set on the target, often years ago, still wins. Select it and press Delete to fall back to the project’s value.

1. Compilation mode

Find it Build Settings › Compilation Mode

Key SWIFT_COMPILATION_MODE

Debug value Incremental singlefile

In Apple’s words, Incremental will “only rebuild the Swift source files in the module that are out of date, running multiple compiler processes as needed”, while Whole Module will “always rebuild all Swift source files in the module, in a single compiler process”. Whole Module is right for release builds, where the optimizer gains from seeing the whole module at once. In a debug build it means a one-line change recompiles every Swift file in that module, in one compiler process.

How it creeps in: a Release configuration copied to make a new one, or an old tip to use Whole Module in debug builds because it made clean builds faster. A clean build is the one you make least often.

2. Optimization level

Find it Build Settings › Optimization Level, under Swift Compiler and under Apple Clang

Keys SWIFT_OPTIMIZATION_LEVEL GCC_OPTIMIZATION_LEVEL

Debug value No optimization: -Onone for Swift, 0 for C and Objective-C

The optimizer is extra work in every compile, and it makes debugging worse: variables are optimized away and steps jump around. It usually creeps in when one screen or one algorithm was too slow to use in a debug build and someone turned optimization on for the whole app. If something really needs to be fast while you debug, turn it on for that one target or package only, or profile with a release build.

3. Debug information format

Find it Build Settings › Debug Information Format

Key DEBUG_INFORMATION_FORMAT

Debug value DWARF dwarf

With DWARF, the debug information stays in the object files, and the debugger on your Mac reads it from there. With DWARF with dSYM File, the build also gathers it into a separate dSYM file after every link, which shows up as the GenerateDSYMFile line in the timing summary. It runs after a one-line change as well, and it takes longer the bigger the app.

You need a dSYM for builds that leave your Mac: the ones you ship or hand to testers, whose crash reports must be symbolicated. A common source of the wrong value is a crash reporting SDK’s setup guide that asks for dSYM files in every configuration. Keep them in the configurations you distribute, and run the SDK’s upload script only there too.

4. Build active architecture only

Find it Build Settings › Build Active Architecture Only

Key ONLY_ACTIVE_ARCH

Debug value Yes YES

With it off, every architecture the target supports is compiled and linked, for example both arm64 and x86_64 for the Simulator. New projects set it to Yes for Debug, and older projects usually have it too.

The catch is the command line. Apple’s documentation says the setting “will be ignored when building with a run destination which does not define a specific architecture, such as a ‘Generic Device’ run destination”. So a command-line build with no destination, or with a generic Simulator destination, compiles every architecture. We checked: with a scheme and no destination, the build settings the command line reports show this setting as off, even when the project turns it on. Scripts, CI and coding agents should name one specific device:

xcodebuild build -scheme MyApp -destination "platform=iOS Simulator,id=$SIMULATOR_ID"

The same documentation also says the scheme’s Override Architectures option, when set to Match Run Destination or Universal, makes the build ignore this setting.

5. Script phases

Find it Build Phases tab › each Run Script phase › Input Files, Output Files and Based on dependency analysis

Then Build Settings › User Script Sandboxing

Key ENABLE_USER_SCRIPT_SANDBOXING

Debug value Yes YES

This isn’t a single setting, but it’s the most common cause of a “no-change” build that still takes seconds. Apple: “By default, Xcode runs custom scripts during every build cycle, including incremental builds.” Apple’s documentation lists when a script phase runs:

The script phase… Does it run?
has Based on dependency analysis unticked On every build
declares no output files On every build
declares no input files On every build
declares both, and an input changed or an output is missing Yes
declares both, and nothing changed No: the build skips it

The build log warns about the first two: “Run script build phase ‘…’ will be run during every build because it does not specify any outputs”, or “because the option to run the script phase ‘Based on dependency analysis’ is unchecked”.

The usual suspects are linters and formatters, code generators, build number scripts, and crash reporting upload scripts. For each one:

  • Give it inputs and outputs. List the files it reads and writes, or put long lists in a file list (an .xcfilelist file). The build then runs it only when an input changed or an output is missing.
  • Move it out of the builds you make all day. A linter can run as a git pre-commit hook or in CI instead. An upload script belongs only in the configurations you distribute.
  • Keep User Script Sandboxing on. It’s the default in new projects. A script that reads or writes a file it didn’t declare then fails the build instead of quietly running with wrong dependencies, which keeps the lists honest. Turning it on in an older project may fail a few scripts at first: those are the ones whose lists were incomplete.

By default, the build runs a target’s consecutive script phases one at a time. Once every script in a target has complete lists and runs on dependency analysis, the Run Build Script Phases in Parallel setting (FUSE_BUILD_SCRIPT_PHASES) lets them run in parallel. Apple’s WWDC22 session on build parallelization warns that it then relies on those lists, and an incomplete one “can lead to data races which are very hard to debug”. Sandboxing is what catches an incomplete list.

If you use CocoaPods: its own phases declare their files, but a pod’s custom script phases (their names start with “[CP-User]”) often don’t. The script lists those too.

6. Settings that shape modules

Find it Build Settings › Preprocessor Macros, C Language Dialect, Objective-C Automatic Reference Counting, Explicitly Built Modules

Keys GCC_PREPROCESSOR_DEFINITIONS GCC_C_LANGUAGE_STANDARD CLANG_ENABLE_OBJC_ARC SWIFT_ENABLE_EXPLICIT_MODULES

Debug value The same in every target where you can

Since Xcode 26, Swift targets build the modules they import (your frameworks’, the SDK’s) as separate tasks the build system schedules. These are explicitly built modules, on by default; C and Objective-C have used them since Xcode 16. A module is built once for each set of settings that affects it, and Apple’s WWDC24 session on explicitly built modules calls each one a variant: “Multiple module variants are caused by different source files having incompatible build settings.” Its examples are extra preprocessor macros, different language modes or standards, and automatic reference counting turned off.

Macros set per target

App · DEBUG=1

Widget · DEBUG=1 WIDGET=1

A shared module, built twice: one variant per set of macros

Macros set once, for the project

App · DEBUG=1

Widget · DEBUG=1

A shared module, built once and used by both

Each different value of a setting that affects a module can build that module again. Apple's advice: "move build settings as broadly as is reasonable in your project".

Set preprocessor macros and language standards once, at the project level or in a shared .xcconfig file, and override them in a target only when it really needs its own. The script lists the settings that differ between your targets and which targets have which value.

If your project turns explicitly built modules off, often a workaround for an error during an upgrade, try it again on a current release.

7. Index data

Find it Build Settings › Enable Index-While-Building Functionality

Key COMPILER_INDEX_STORE_ENABLE

Value Leave it in the IDE; turn it off for command-line builds

In debug builds, the compiler also writes index data, which keeps jump-to-definition, search and refactoring up to date in the editor. In the IDE, leave it on. Builds from the command line, like CI, scripts and coding agents, have no editor reading that data, so they can skip it:

xcodebuild build -scheme MyApp -destination "platform=iOS Simulator,id=$SIMULATOR_ID" \
  -derivedDataPath .build/derived COMPILER_INDEX_STORE_ENABLE=NO

Two cautions. A setting passed on the command line changes how files are compiled, so give those builds a build folder of their own, as the derived data path above does: if they share one with the IDE, each kind of build redoes the other’s work. And tools that read the index, like Periphery for unused code, need it on.

8. Eager linking

Find it Build Settings › Eager Linking

Key EAGER_LINKING

Debug value Try Yes YES; it's off by default

From Apple’s description: “the build system will emit a TBD file for Swift-only framework and dynamic library targets to unblock linking of dependent targets before their dependency has finished linking.” In other words, the app can start linking against your framework while the framework is still linking. The WWDC22 session says it applies to pure Swift targets that are linked dynamically. Static libraries and packages linked statically, the default for Swift packages, gain nothing. If your app is split into several Swift-only dynamic frameworks, try it and measure.

All of it in one .xcconfig

If your project uses .xcconfig files, the values that should hold in every target fit in the one for your Debug configuration:

// The configuration you build all day
SWIFT_COMPILATION_MODE = singlefile
SWIFT_OPTIMIZATION_LEVEL = -Onone
GCC_OPTIMIZATION_LEVEL = 0
DEBUG_INFORMATION_FORMAT = dwarf
ONLY_ACTIVE_ARCH = YES
ENABLE_USER_SCRIPT_SANDBOXING = YES

A value set on a target in the Build Settings tab still wins over the file (the figure above), so delete those target-level values. Eager Linking and Run Build Script Phases in Parallel are left out on purpose: try them per target, and measure.

Change one at a time, and measure

Each of these settings only costs you time when it’s wrong, so measure before you change anything. Time the same build three times, change one setting, and time it again. Our guide to the build timeline shows how, and the time-build.sh script does the timing. Commit the settings that help, in an .xcconfig file if you have one, so a new target doesn’t bring the old values back.

What’s left

Right settings remove the waste. They don’t shorten the work a well-configured large app still does after a one-line change, and that’s the part we’re working on with Quickfire: faster everyday builds of large apps, on the project you already have. Early access opens in early 2027.