1

I'm trying to build my XCode project via the terminal. I'd like use Xcode's Product > Build for > Profiling option. So far I have:

xcodebuild -project "MyGame.xcodeproj" -target "MyGameEditor - Mac" -destination 'name=My Mac 64-bit' -configuration Profile

The project builds but not for profiling. I get an error that configuration 'Profile' does not exist.

Any help is appreciated.

basheps
  • 10,034
  • 11
  • 36
  • 45

1 Answers1

1

What you are trying to sepcify with -configuration is the build configuration, not the build action. Unless you have added extra configurations to your project, you only have "Debug" and "Release" configurations.

What Xcode does when you tell it to profile is it builds the configuration that your scheme specifies to use when profiling, launches the simulator, installs the app, then launches Instruments.

So you need to do a similar thing with two command line calls, one to xcodebuild, one to instruments.

Some helpful links that should help you figure out what you need to do:

http://blog.manbolo.com/2013/04/09/launching-uiautomation-tests-in-command-line

Can the UI Automation instrument be run from the command line?

It is also worth noting that rather than specifying a target and configuration, you should just specify a scheme which provides both and other optional additional features.

Community
  • 1
  • 1
Simon Goldeen
  • 9,080
  • 3
  • 36
  • 45
  • I'm trying to build a C++ Project for the Unreal Engine Editor. The instructions for the Mac build is to use Menu > Product > Build for > Profiling and it will save the project to be able to be opened in the UnrealEditor. If I don't build for Profile then the project is not available. I'm trying to recreate the action using the terminal so that I don't have to open XCode simply to perform that one task. – basheps Jun 09 '14 at 18:59