43

I am setting up my iphone project to run with hudson, my build script works fine locally, but when executing the following command on my snow leopard server mac

xcodebuild -sdk iphoneos4.3 -workspace Moments.xcworkspace/ -scheme Moments -configuration DistributionTest

I get the following error messages.

Build settings from command line: SDKROOT = iphoneos4.3

2011-05-11 10:32:17.729 xcodebuild[4151:903] WARNING: Timed out waiting for /"runContextManager.runContexts" (10.010780 seconds elapsed) xcodebuild: error: The workspace 'Moments.xcworkspace/' does not contain a scheme named 'Moments'.

What's the timeout about?! And why can't it find the scheme named Moments when it's definitly there. If I open the workspace in xcode on the build server, I can see the scheme.

Erik
  • 5,791
  • 5
  • 30
  • 45

3 Answers3

96

checking the "shared" box in the "Manage Schemes" dialog moves the schemes to Project.xcodeproj/xcshareddata/xcschemes/Scheme.xcscheme

so even if you have a clean checkout that has never been opened via the xcode ui, this will work. we use this so that buildbot can build our apps

David
  • 1,024
  • 8
  • 3
  • Woohoo!!! People visiting this page!!! The checked answer is good but this one is even better! Thanks @David! – Mick F Mar 12 '12 at 16:05
  • 2
    Once you change your scheme to be shared be sure to add the following directory to SVN/git: {Project}.xcodeproj/xcshareddata/* – TPoschel Jun 07 '12 at 15:12
10

Unfortunately xcodebuild depends on some per user files generated by the XCode. To fix this you can log in as your hudson user and run the XCode UI once. That will create the necessary files.

I'm currently trying to work around this, but copying the needed files into the source tree before building.

If you run xcodebuild and XCode is running in the background, xcodebuild will contact XCode to get the needed data. Since XCode is not running, you get the timeout.

-2

Schemes are per default not shared between users (and your build-server). As David mentions, you can share them, but you can also just invoke the targets instead, which are shared.

So instead of

xcodebuild -scheme Foobar

it'd be

xcodebuild -target Foobar

since schemes are normally named the same as the target.

Community
  • 1
  • 1
Grav
  • 1,714
  • 14
  • 27
  • If i understand the documentation correctly you can not use the -target flag if you're using the -workspace flag. Meaning if you rely on workspaces you need to use schemes and the solution to the problem has been provided by David and Cornelius – Erik Jul 31 '12 at 08:37