How to append to the HEADER_SEARCH_PATHS using xcodebuild?

Viewed 607

I have a 3rd party project (have source, can't really modify the project itself) that link against a library I'm trying to modify.

I want to rebuild the 3rd party app but want to append an extra Header search path so that it would use my version of the library, instead of the default location.

However I can't find a way to do this properly with xcodebuild.

I tried adding HEADER_SEARCH_PATHS="/my/library/headers" at the end of the xcodebuild command line, but this will override the project settings rather than append to it.

1 Answers

You can do that like this:

xcodebuild -scheme MyScheme HEADER_SEARCH_PATHS='$(HEADER_SEARCH_PATHS) additional-path'

Note that using single quote is important or else your shell will interpret $(HEADER_SEARCH_PATHS) as a command.

You can use -showBuildSettings switch to check if all settings are set as desired without building it right away:

xcodebuild -scheme MyScheme -showBuildSettings HEADER_SEARCH_PATHS='$(HEADER_SEARCH_PATHS) additional-path'
Related