简体   繁体   中英

Multiple command line tool targets in a single project in Xcode

Is it possible to have multiple command line tool targets in a single project? I'm writing C++ with command line tool, and could build the first target but failed for the second one.

I'm using Xcode 4.1, Mac 10.7.4.

You can have multiple targets and build each of them from xcode commandline tools. You can specify the target from command line tool like:

xcodebuild -sdk iphonesimulator6.0 -target "HelloWorld"

and you can repeat this for each target. I also came across to building workspaces direclty you can check that out too.

Apple's Document about it;

If you have multiple projects in the this directory you will need to use -project to indicate which project should be built. By default, xcodebuild builds the first target listed in the project, with the default build configuration. The order of the targets is a property of the project and is the same for all users of the project.

https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html

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