~/Library/Developer/Xcode/DerivedData/<ProjectName-hash>/Build/Products/. You can quickly reveal a compiled binary by right-clicking your application under the Products group in Xcode and selecting Reveal in Finder, or check custom paths under File > Project Settings (or Workspace Settings).Why this happens
In early versions of Xcode, build artifacts were placed directly inside a build directory at the root of the project folder. Apple changed this default behavior to prevent build clutter inside source-controlled repositories, eliminate file-locking conflicts across git branches, and improve compiler caching.
Modern Xcode versions route all compiled binaries, intermediate object files, precompiled module headers, and index stores into a shared user directory called DerivedData. Each project receives an isolated, unique subfolder inside DerivedData that incorporates a cryptographically generated hash appended to the project or workspace name.
Because this directory is placed deep within the user’s hidden ~/Library path rather than the project root, developers often struggle to find generated .app files, dSYM bundles, or framework binaries required for manual distribution, command-line testing, or profiling.
How to fix it
1. Locate the default DerivedData path in Finder or Terminal
Unless you or your team have customized Xcode’s global preferences, all builds compile into your personal Library folder.
The full default path to the build products folder is:
~/Library/Developer/Xcode/DerivedData/<ProjectName-hash>/Build/Products/
To jump straight to this folder:
- Open Finder.
- Press
Command + Shift + Gto open the Go to Folder dialog. - Paste
~/Library/Developer/Xcode/DerivedDataand press Return. - Find the folder named after your project (for example,
MySampleApp-abcdefghijklmnop). - Open
Build>Products. - Select the active configuration and target folder, such as
Debug-iphonesimulator,Debug-iphoneos, orRelease-iphoneos.
You can also jump to the latest build folder directly from your terminal using mdfind or shell expansion:
cd ~/Library/Developer/Xcode/DerivedData
ls -td */ | head -n 1
This command navigates to DerivedData and lists the most recently modified project directory.
2. Reveal the binary directly from Xcode
If you have the project open in Xcode, you do not need to manually browse directories in Finder.
- In the Project Navigator (
Command + 1), expand your project structure. - Locate the Products group. In modern Xcode versions, this may appear under Frameworks & Libraries or at the bottom of the navigation tree.
- Locate your compiled application target (for example,
MySampleApp.app).
– If the file text is black, the target has been built and exists on disk.
– If the file text is red, Xcode has not compiled that target for the currently selected run destination yet. - Right-click the
.appor framework file. - Select Show in Finder (or Reveal in Finder).
If the Products group is hidden in your project tree:
- Open the Report Navigator (
Command + 9). - Select your most recent Build entry.
- Scroll to the bottom of the build transcript where the linking and code signing steps take place.
- Hover over the final
GenerateDSYMFileorCodeSignstep and click the small disclosure icon on the far right to see the full output path of the final.appbundle.
3. Check and customize Project or Workspace Settings
Your team or build scripts may have redirected the build location away from the global DerivedData directory.
To view or change where the current project writes its output:
- In Xcode, choose File > Project Settings… (or File > Workspace Settings… if you are working within an
.xcworkspace). - Look at the Derived Data dropdown menu.
– Default Location: Places files in~/Library/Developer/Xcode/DerivedData.
– Project-Relative Location: Places files into a custom subfolder inside your project directory (such as./buildor./DerivedData).
– Custom: Allows you to set a fixed absolute path on your Mac. - Click the Advanced… button to inspect the Build Products Path and Intermediate Files Path.
– Unique: Creates individual project-hashed subdirectories.
– Shared Folder: Puts all targets into a single shared folder.
– Legacy: Restores the historic behavior of placing the build folder alongside the project file.
4. Locate artifacts generated by xcodebuild (CLI)
When using command-line tools for Continuous Integration (CI) or automated tests, xcodebuild follows Xcode’s global DerivedData path by default. You can query the exact build directory programmatically or override it.
To print the exact output directory that xcodebuild will use for your project without opening Finder:
xcodebuild -project MyProject.xcodeproj -scheme MyScheme -showBuildSettings | grep -E "\b(TARGET_BUILD_DIR|BUILT_PRODUCTS_DIR)\b"
To force xcodebuild to place the build folder directly in your working directory, use the -derivedDataPath flag:
xcodebuild build \
-workspace MyProject.xcworkspace \
-scheme MyScheme \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' \
-derivedDataPath ./build
With this flag specified, your application binary is consistently placed inside ./build/Build/Products/Debug-iphonesimulator/MyScheme.app, making automated collection and archiving straightforward.
How to prevent it
- Add a post-build run script to your target scheme if you frequently need output binaries copied to a fixed location such as
~/Desktop. - Standardize CI build scripts with an explicit
-derivedDataPathflag to avoid reliance on user-specific macOS home folders. - Avoid switching projects to “Legacy” build locations if your repository uses Git, unless your
.gitignoreexplicitly ignoresbuild/andDerivedData/. - Bookmark
~/Library/Developer/Xcode/DerivedDatain your Finder sidebar favorites for fast access across projects.
FAQ
Why does my project’s .app file show in red in Xcode?
A red .app file in the Project Navigator indicates that the file does not exist at the resolved path on disk. Build your project (Command + B) for the currently active scheme and destination to compile the target and populate the folder.
Does deleting the DerivedData build folder harm my project?
No. The build products and intermediate files inside DerivedData are recreated automatically the next time you compile. Deleting this folder is a standard troubleshooting technique to resolve stale asset catalogs and compiler state bugs.
Can I share one build folder across all my targets?
Yes. Under File > Project Settings > Advanced, you can configure build locations to use a “Shared Folder”. However, this is generally discouraged for parallel builds because concurrent targets may overwrite intermediate headers and object files.
Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.
