Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild error scheme not configured for running

I'm trying to setup a jenkins environment for automated build. Everything works ok, when I'm in project development folder. However running same command from "jenkins" folder fails:

xcodebuild -scheme myApp -workspace my-app.xcworkspace -configuration Release build

with error note:

xcodebuild: error: Failed to build workspace my-app with scheme myApp.
Reason: Scheme "myApp" is not configured for running.

Whether scheme "myApp" is in container project or workspace, which contains that project, makes no difference whatsoever. When looking inside the scheme file, it seems like running should be ok (but I have to confess I have no idea why running would be needed for plain build):

<BuildAction
  parallelizeBuildables = "NO"
  buildImplicitDependencies = "YES">
  <BuildActionEntries>
     <BuildActionEntry
        buildForTesting = "YES"
        buildForRunning = "YES"
        buildForProfiling = "YES"
        buildForArchiving = "YES"
        buildForAnalyzing = "YES">
        <BuildableReference
           BuildableIdentifier = "primary"
           BlueprintIdentifier = "C0D73B7A15EF580200AFFFA5"
           BuildableName = "myApp.app"
           BlueprintName = "myApp"
           ReferencedContainer = "container:myApp.xcodeproj">
        </BuildableReference>
     </BuildActionEntry>
</BuildActionEntries>

Any guesses what could be the problem? I've reset, reconfigured, cleaned, removed, recreated etc. all related schemes and workspace and run out of ideas... Now I'll go and buy Kaleidoscope, hope it can show some hidden magical differences.

Update: One obvious difference is that jenkins is missing all of my xcuserdata folders and stuff inside them. Could that somehow cause this error?

like image 799
JOM Avatar asked Jan 23 '13 13:01

JOM


1 Answers

Not sure if this is your problem, but you will see this error if xcodebuild could not load the referenced project.

Make sure that:

myApp.xcodeproj folder should be in the same folder as my-app.xcworkspace.

Also, there should be a <FileRef> entry in my-app.xcworkspace/contents.xcworkspacedata file which says something to the effect of container:myApp.xcodeproj.

like image 91
yiding Avatar answered Oct 18 '22 17:10

yiding