Skip to content

[Bug]: build_sim fails with CocoaPods projects - xcfilelist path resolution error #166

@nebooz

Description

@nebooz

Description

Building a CocoaPods-based iOS project via build_sim (or build_run_sim) fails with xcfilelist path errors, even though the same project builds successfully with native xcodebuild.

Environment

  • XcodeBuildMCP version: 1.15.1
  • Xcode version: 26.2 (Build 17C52)
  • macOS: Darwin 25.2.0 (arm64, Apple M4 Max)
  • Node.js: v22.17.0

Setup

We configured session defaults:

workspacePath: /Users/.../neat-photo/NeatApp.xcworkspace
scheme: NeatPhoto-Local
simulatorId: A7121CCC-2EC1-40E0-B235-349FCE43A5CC
useLatestOS: true

Error

When running build_run_sim or build_sim, we get errors like:

error: Unable to load contents of file list: '/Target Support Files/FirebaseAnalytics/FirebaseAnalytics-xcframeworks-input-files.xcfilelist' (in target 'FirebaseAnalytics' from project 'Pods')

Note the path starts with /Target Support Files/... instead of the full path. The files exist at:

/Users/.../neat-photo/Pods/Target Support Files/FirebaseAnalytics/FirebaseAnalytics-xcframeworks-input-files.xcfilelist

Native xcodebuild works

Running the same build directly from the terminal succeeds:

cd /Users/.../neat-photo
xcodebuild -workspace NeatApp.xcworkspace -scheme NeatPhoto-Local \
  -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.5' build
# ** BUILD SUCCEEDED **

Suspected Cause

After reviewing the source code, it appears xcodebuild may not be invoked with cwd set to the project directory. In src/utils/build-utils.ts, projectDir is extracted from the workspace path but only used for xcodemake operations, not passed to the command executor for xcodebuild.

In src/utils/command.ts, the spawn options use cwd: opts?.cwd which defaults to undefined (inheriting the MCP server's working directory rather than the project directory).

Possible Fix

Pass the project directory as cwd when executing xcodebuild:

await executor(command, platformOptions.logPrefix, true, { ...execOpts, cwd: projectDir })

Questions

  1. Are we missing a configuration option to set the working directory?
  2. Is there a workaround for CocoaPods projects?
  3. Is this a known limitation?

Thanks for the great tool! The UI automation and simulator management features work wonderfully - we just can't get the build step working for our CocoaPods project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions