xcodexcodebuild

Generate an .xcscheme file from the command line


I am working on my company's continuous integration server, and the build process is failing because the server does not have access to schemes in an xcode project.

Basically, they are using Cmake to generate xcode projects on the fly to be used for a single build, and then discarded until the next check in.

My research indicates that this problem will be fixed if there is an .xcscheme file with the .xcodeproj file, but for various reasons that can't be generated and checked in ahead of time.

Is there a way to generate this file using xcodebuild or some other command line tool so that we can work it into existing build shell scripts?

The xcodebuild documentation, google, and S.O. are surprisingly lacking on this topic.


Solution

  • I was actually able to do this by using cmake to generate the project, then using the xcode gui to make the scheme files I need. I used the terminal to extract the xcscheme files from the project and put them in another directory being tracked by source control. As part of the generation process, I just added a bit of shell script to copy the copies I made earlier into the newly generated project, then continue the build process as normal.