<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau" -->

---
title: Optimizing compilation and test runs with Xcode projects
description: Tuist explains why Xcode&#x27;s build system lacks hermeticity, which prevents optimizations like caching and incremental builds that tools like Bazel or Gradle...
canonical: https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Optimizing compilation and test runs with Xcode projects | daily.dev
og:description: Tuist explains why Xcode&#x27;s build system lacks hermeticity, which prevents optimizations like caching and incremental builds that tools like Bazel or Gradle...
og:url: https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau
og:image: https://api.daily.dev/og/posts/VFHEzsfau.png
og:image:alt: Optimizing compilation and test runs with Xcode projects
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimizing compilation and test runs with Xcode projects

**[
      Tuist
    ](https://daily.dev/sources/tuist-blog)** · 4 min read · 0 upvotes · 0 comments

## Summary

Tuist explains why Xcode's build system lacks hermeticity, which prevents optimizations like caching and incremental builds that tools like Bazel or Gradle enable. It describes how Tuist's Swift DSL generates Xcode projects, encourages explicit dependency declarations, and uses Merkle trees to identify unchanged targets for binary caching and selective test execution. The combined caching and selective testing approach can cut CI times by up to 70% or more, without replacing Xcode's build system.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tuist.dev/blog/2024/11/18/optimizing-compilation-and-test-runs-with-xcode-projects>

## Questions this post answers

### Why can't Xcode cache and skip compilation steps the way Bazel or Gradle do?

Xcode's build system lacks hermeticity, meaning it does not reliably produce identical output given the same input across environments. Causes include implicit dependencies based on heuristics, shared derived data caches, reliance on environment variables or user-specific configuration, and non-hermetic scripts with unpinned external commands. Without hermeticity, artifact caching and sharing across machines becomes unreliable, which is why Apple hasn't implemented graph-level build optimization directly.

_Developers weighing build-system tradeoffs for iOS projects can follow ongoing Xcode tooling coverage on daily.dev._

### How does Tuist speed up Xcode compilation and test runs?

Tuist generates Xcode workspaces and projects from a Swift DSL that models the project as a graph, then builds a Merkle tree to create unique identifiers per target so unchanged targets can reuse cached binaries and skip re-running tests. Commands like tuist cache, tuist generate, tuist build, and tuist test let teams reuse cached binaries and selectively re-run only affected tests, improving CI times by up to 70% or more.

_Teams chasing faster iOS CI pipelines can track build-tooling techniques like this via daily.dev._

## Similar posts on daily.dev

- [Toss: Building less to ship faster](https://daily.dev/posts/toss-building-less-to-ship-faster-1arhtus0n) · 
      Tuist
     · 3 upvotes · 0 comments
- [The new Tuist, from build toolchains to bare metal](https://daily.dev/posts/the-new-tuist-from-build-toolchains-to-bare-metal-waw3c6jvd) · 
      Tuist
     · 0 upvotes · 0 comments

---

Tags: [#ios](https://daily.dev/tags/ios), [#swift](https://daily.dev/tags/swift), [#xcode](https://daily.dev/tags/xcode), [#build-systems](https://daily.dev/tags/build-systems)

[View this post on daily.dev](https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Optimizing compilation and test runs with Xcode projects","url":"https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau"},"datePublished":"2026-08-23T12:23:48.178Z","dateModified":"2026-08-23T12:55:57.119Z","description":"Tuist explains why Xcode's build system lacks hermeticity, which prevents optimizations like caching and incremental builds that tools like Bazel or Gradle...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/13580710a48bf921426d29a910dea4e4?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/13580710a48bf921426d29a910dea4e4?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"\n      Tuist\n    ","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"\n      Tuist\n    ","logo":"https://media.daily.dev/image/upload/s--3AYDH23h--/f_auto,q_auto/v1787487506/logos/tuist-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/tuist-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ios,swift,xcode,build-systems","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"\n      Tuist\n    ","item":"https://daily.dev/sources/tuist-blog"},{"@type":"ListItem","position":3,"name":"Optimizing compilation and test runs with Xcode projects"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/optimizing-compilation-and-test-runs-with-xcode-projects-vfhezsfau#faq","mainEntity":[{"@type":"Question","name":"Why can't Xcode cache and skip compilation steps the way Bazel or Gradle do?","acceptedAnswer":{"@type":"Answer","text":"Xcode's build system lacks hermeticity, meaning it does not reliably produce identical output given the same input across environments. Causes include implicit dependencies based on heuristics, shared derived data caches, reliance on environment variables or user-specific configuration, and non-hermetic scripts with unpinned external commands. Without hermeticity, artifact caching and sharing across machines becomes unreliable, which is why Apple hasn't implemented graph-level build optimization directly. Developers weighing build-system tradeoffs for iOS projects can follow ongoing Xcode tooling coverage on daily.dev."}},{"@type":"Question","name":"How does Tuist speed up Xcode compilation and test runs?","acceptedAnswer":{"@type":"Answer","text":"Tuist generates Xcode workspaces and projects from a Swift DSL that models the project as a graph, then builds a Merkle tree to create unique identifiers per target so unchanged targets can reuse cached binaries and skip re-running tests. Commands like tuist cache, tuist generate, tuist build, and tuist test let teams reuse cached binaries and selectively re-run only affected tests, improving CI times by up to 70% or more. Teams chasing faster iOS CI pipelines can track build-tooling techniques like this via daily.dev."}}]}
```

