Build in xcode via terminal, using the "build for profiler" settings

14,827

Solution 1

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/

Solution 2

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

enter image description here

Share:
14,827
Admin
Author by

Admin

Updated on June 21, 2022

Comments

  • Admin
    Admin almost 2 years

    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!