Reputation:
Is there a way to specify to xcodebuild, to build a specific scheme/configuration?
I have a project with multiple related projects; and when I want to build all, I just run it with "build for profiler", and it takes care to grab the right code, the right related projects in the solution and give me the resulting products compiled, and ready to be tested.
I am trying to automate the process, so I can run it via console; altho I've found no documentation that specify how to build for specific settings that you have in Xcode UI, but using the console version (xcodebuild).
I can build each project separately, and put all together by hand, but it is laborious and error prone; I would rather go for what Xcode does, but without using the UI at all.
Not even sure if it is possible; any pointer is more than welcome. Thanks!
Upvotes: 8
Views: 15301
Reputation: 7524
If you want to build a .xcworkspace
use
xcodebuild -workspace your_project.xcworkspace -scheme your_sheme
Here is a description where you find your scheme.
Tldr: left click on your project (red arrow) -> manage scheme -> use the selected one
Upvotes: 6
Reputation: 1316
Here is an example:
$ xcodebuild -project MyProject.xcodeproj -alltargets -configuration Release
You can get the full documentation in the terminal with this command:
$ man xcodebuild
There is also an article here: http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
Upvotes: 9