Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

xcodebuild cannot find the scheme you asked it to build

Errordoes not contain a scheme named

Short answer

xcodebuild only sees schemes that exist in the project or workspace you name on the command line. Run xcodebuild -list on that same container and read the Schemes section. The error means the name is wrong, the scheme lives in the other container, or it was never shared with the build machine.

  • Applies to Xcode 26, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask xcodebuild itself which schemes it can see, using the same container you pass to the failing build. Compare the printed names with your -scheme value.

    xcodebuild -list -workspace MyApp.xcworkspace
    # or, for a project without a workspace
    xcodebuild -list -project MyApp.xcodeproj
  2. 2Match what you see, then jump to its fix

    1. 1The Schemes section is printed, but your name is not in it, or differs in spelling or caseThe scheme name does not match what the list showsFix
    2. 2The scheme shows in xcodebuild -list -workspace but not in xcodebuild -list -projectThe scheme belongs to the workspace, but you passed the project (or the reverse)Fix
    3. 3Xcode builds fine locally, but a CI machine or another account does not list the schemeThe scheme exists only on your Mac because it is not sharedFix

What does the error look like?

  • does not contain a scheme named
  • xcodebuild: error: ... does not contain scheme

Cause 1 of 3

The scheme name does not match what the list shows

1Check

Schemes are named by you, and a rename in Xcode does not change a script that still holds the old name.

xcodebuild -list -project MyApp.xcodeproj

2Fix

Copy the name from the Schemes section into the -scheme argument. Quote it when it contains a space.

xcodebuild -scheme "My App" -project MyApp.xcodeproj build

3Verify

The build starts instead of printing the error.

xcodebuild -scheme "My App" -project MyApp.xcodeproj build

Confirmed by developer.apple.com

Did this fix it?

Cause 2 of 3

The scheme belongs to the workspace, but you passed the project (or the reverse)

1Check

Apple documents -workspace for a scheme contained in a workspace and -project for a scheme contained in a project. A CocoaPods or multi-project setup keeps the app scheme in the workspace.

xcodebuild -list -workspace MyApp.xcworkspace
xcodebuild -list -project MyApp.xcodeproj

2Fix

Pass the container that actually lists the scheme.

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp build

3Verify

Rerun the build with the workspace on the command line.

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp build

Confirmed by developer.apple.com

Did this fix it?

Cause 3 of 3

The scheme exists only on your Mac because it is not shared

1Check

Fastlane's build_app documentation asks that the scheme be marked Shared. Check that the project holds a shared scheme file, not only your user data.

find . -path "*xcshareddata/xcschemes/*.xcscheme" -not -path "./Pods/*"

2Fix

In Xcode click the scheme name in the toolbar, choose Manage Schemes, tick Shared for the scheme, then commit the new xcscheme file to source control.

git add MyApp.xcodeproj/xcshareddata/xcschemes/MyApp.xcscheme
git commit -m "Share the MyApp scheme"

3Verify

On the CI machine, after pulling, list the schemes again.

xcodebuild -list -project MyApp.xcodeproj

Confirmed by docs.fastlane.tools

Did this fix it?

How do I stop it coming back?

  • Keep the scheme shared and committed, so every build machine sees it.
  • Run xcodebuild -list once in the build script's first step, and fail early with the output.
  • Pass both the container and the scheme explicitly rather than relying on the current folder.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.