xcconfig是一个保存xcode工程各种配置的纯文本文件,如果被使用,会覆盖掉相同的配置项,我们可以利用它进行管理工程使得同样的工程使用不同的预定义参数或编译期产生其他行为。
File > New-File > iOS > Other > Configuration Setting File
Xcode Document
中搜索 Xcode Build Setting Reference: Build Setting Reference
,有所有参数说明
相关资料:
目标平台
TARGETED_DEVICE_FAMILY
- 1:iPhone/iPod touch. (Default)
- 2:iPad.
- 1,2:iPad.
TARGETED_DEVICE_FAMILY = 1,2
Space-separated list of directory paths. Specifies the run-path locations at which the dynamic loader searches for the product’s run-path dependent libraries. See * Dynamic Library Programming Topics. *
LD_RUNPATH_SEARCH_PATHS
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
是否用pch文件
GCC_PRECOMPILE_PREFIX_HEADER
- YES: Target generates a prefix header when the prerequisite is met.
- NO: Target does not generate a prefix header.
GCC_PRECOMPILE_PREFIX_HEADER = YES
pch文件路径
GCC_PREFIX_HEADER
GCC_PREFIX_HEADER = MyProduct_Prefix.pch
Info.plist文件路径
INFOPLIST_FILE
INFOPLIST_FILE = Info.plist
包名
PRODUCT_NAME
PRODUCT_NAME = PRODUCT_NAME
Specifies whether the product includes only object code for the native architecture
ONLY_ACTIVE_ARCH
- YES: The product includes only code for the native architecture (NATIVE_ARCH).
- NO: The product includes code for the architectures specified in ARCHS (Architectures).
如果用了Cocoapods
,要加上 Pods/Target Support Files/Pods/Pods.debug.xcconfig
或 Pods/Target Support Files/Pods/Pods.release.xcconfig
Xcode > Project > Info > Configurations
修改各个Taget 的 Debug 和 Release 对应的xcconfig文件
File > New-File > iOS > Other > Shell Script
Xcode > TARGETS > Build Phases > + > New Run Script Phase