Skip to content

iOS runner build ignores -derivedDataPath when Xcode uses a custom build location #3296

Closed

Description

@sergdort

Version: agent-device 0.21.19, Xcode 27 beta, macOS

What happens

When Xcode's global preference sets a custom build location, prepare ios-runner (and the first open on iOS) fails:

Failed to locate .xctestrun after build

Xcode writes the runner products relative to the runner project (dist/apple/runner/AgentDeviceRunner/Build/...) instead of the derived data path that agent-device passes. Parallel attempts can also fail with database is locked.

How to reproduce

defaults write com.apple.dt.Xcode IDEBuildLocationStyle Custom
defaults write com.apple.dt.Xcode IDECustomBuildLocationType RelativeToWorkspace
defaults write com.apple.dt.Xcode IDECustomBuildProductsPath Build/Products
agent-device prepare ios-runner --platform ios

Cause

IDEBuildLocationStyle=Custom takes precedence over -derivedDataPath for build products. Teams use this setting so that Xcode and command-line tools share one products folder.

Suggested fix

Add -IDEBuildLocationStyle=Unique to the runner build arguments, for example in RUNNER_SANDBOX_BUILD_ARGS (packages/platform-apple/src/runner/runner-cache-metadata.ts). With this argument the runner builds into the agent-device derived data path again. We verified the change locally by patching dist/src/runner-cache-metadata.js: prepare ios-runner then succeeds.

An alternative is an environment variable for extra xcodebuild arguments.

Activity

  1. thymikee commented on Oct 8, 2026

    @thymikee
    Member

    Fixed by #3158 (first released in v0.21.21): the runner build pins SYMROOT/OBJROOT under the derived-data path, so a custom Xcode build location no longer redirects it. Covered by runner-artifact-build-location.test.ts. You reported this on 0.21.19, so please upgrade; reopen if it still happens. The parallel "database is locked" side note isn't covered here; file it separately if it recurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions