carlos_ms
carlos_ms

Reputation: 838

xcodebuild - how to use build settings from xcode

I'm trying to build several targets and I already have Build Settings per target in Xcode. I also have a scheme per target. What I'm trying to do is issue one command line instruction to build each target, something like:

xcodebuild -project MyProject.xcodeproj -scheme PRODScheme archive -archivePath /Users/myUser/Documents/PRODApps/archives/"${PRODUCT_NAME}".xcarchive -configuration Release

Here, ${PRODUCT_NAME} is the Build Setting variable defined by XCode. I'm thinking on how xcodebuild can make use of the bunch of already defined settings.

Is there a way of reusing those settings in xcodebuild?

Upvotes: 1

Views: 3880

Answers (1)

l'L'l
l'L'l

Reputation: 47159

Typically you would use the scheme, which would contain the other information you are trying to include:

xcodebuild -scheme PRODScheme build

To use with a configuration file you would use:

xcodebuild -target MyProject.xcodeproj -xcconfig configuration.xcconfig

To build all targets use -alltargets


Command Line tech notes: https://developer.apple.com/library/ios/technotes/tn2339/_index.html

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

Upvotes: 2

Related Questions