简体   繁体   中英

Xcode Build for Profiling via Terminal

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM