Locating Xcode’s Build Folder: A Comprehensive Guide

Locating Xcode's Build Folder: A Comprehensive Guide

28 February 2025 Stephan Petzl Leave a comment Xcode

When working with Xcode, understanding where your build products are stored can be crucial for efficient workflow management. This guide will assist you in locating and configuring Xcode’s build folder settings, ensuring you maintain control over your project’s build outputs.

Default Build Folder Location

By default, Xcode stores build products in the DerivedData directory. This is located at:

~/Library/Developer/Xcode/DerivedData

Customizing Build Directory

If you prefer to customize where your build products are stored, you can set the preferences in Xcode to specify build directories per project. Follow these steps:

  • Go to File > Workspace Settings.
  • In the dialog, under Build Location, you can choose between Default, Project-relative, or Custom locations.

Advanced Configuration

For more advanced users, setting the CONFIGURATION_BUILD_DIR environment variable allows you to specify a custom build directory. This can be useful for creating autonomous build locations for different targets within your project.

Add User-Defined Setting -> CONFIGURATION_BUILD_DIR

Handling Derived Data

It’s important to note that during development, if you delete the DerivedData directory, the path to your build products may change upon rebuilding. Therefore, managing this directory carefully is advised.

Practical Example: Using Run Scripts

To ensure your build products are always in a known location, you can use a script to copy them post-build. For example, in a framework project, you might add a new run script phase in Xcode:

cp -R ${BUILT_PRODUCTS_DIR}/MyProduct.framework ${PROJECT_DIR}/MyProduct.framework

This script copies the framework directory to your project directory, making it easily accessible.

Enhancing Test Automation with Repeato

For developers seeking to streamline their testing process, Repeato offers a compelling solution. As a no-code test automation tool, Repeato allows you to create, run, and maintain automated tests for iOS, Android, and web applications efficiently. Its computer vision and AI capabilities make test recording and execution both fast and intuitive.

Repeato supports command line scripts and JavaScript code, providing flexibility for complex tasks. Furthermore, with data-driven and keyword-driven testing options, it caters to a wide range of testing needs. All tests and workspace data are saved in text and JSON formats, facilitating easy version control.

For more details on how Repeato can enhance your test automation, explore our documentation or visit our blog for insights and updates.

Like this article? there’s more where that came from!