Xcode环境变量备忘

Xcode build setting中的配置或者在xcode环境中运行相关脚本会涉及到各种系统的环境变量,参考Xcode环境变量苹果官方文档,做个记录,便于以后查询,以下只记录部分我个人觉得重要的部分。

可以通过下面图的方式观察具体变量代表的值,TARGET_NAME就是其中一个环境变量。


Xcode环境变量备忘_第1张图片
添加script


build之后可以在,下图提示的位置看到对应的输出,可以看到TARGET_NAME的相应输出,和箭头处的标识符合。

Xcode环境变量备忘_第2张图片
脚本输出观察

以上面截图工程为例,以下部分参数输出仅供参考

TARGET_NAME:XcodeEnvironment

PRODUCT_NAME:XcodeEnvironment

PROJECT_NAME:XcodeEnvironment

EXECUTABLE_NAME:XcodeEnvironment

ACTION:build (有以下值build、clean、install、installhdrs、installsrc)

CONFIGURATION:Debug (有以下值Release、Debug、自定义的configuration名字)

EFFECTIVE_PLATFORM_NAME:-iphonesimulator(有以下值-iphonesimulator、-iphoneos需注意左边有-)

PLATFORM_NAME:iphonesimulator(同上,左边没有-)

INFOPLIST_FILE:XcodeEnvironment/Info.plist

INFOPLIST_PATH:XcodeEnvironment.app/Info.plist


BUILD_DIR:/Users/xxx/Library/Developer/Xcode/DerivedData/XcodeEnvironment-dmkavzwgusnoijcmnnqnjugejruj/Build/Products

BUILD_ROOT:/Users/xxx/Library/Developer/Xcode/DerivedData/XcodeEnvironment-dmkavzwgusnoijcmnnqnjugejruj/Build/Products

SYMROOT:/Users/xxx/Library/Developer/Xcode/DerivedData/XcodeEnvironment-dmkavzwgusnoijcmnnqnjugejruj/Build/Products

BUILT_PRODUCTS_DIR:/Users/xxx/Library/Developer/Xcode/DerivedData/XcodeEnvironment-dmkavzwgusnoijcmnnqnjugejruj/Build/Products/Debug-iphonesimulator

TARGET_BUILD_DIR:/Users/xxx/Library/Developer/Xcode/DerivedData/XcodeEnvironment-dmkavzwgusnoijcmnnqnjugejruj/Build/Products/Debug-iphonesimulator

SDKROOT:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk

SRCROOT:/Users/xxx/Desktop/XcodeEnvironment

PROJECT_DIR:/Users/xxx/Desktop/XcodeEnvironment

HOME:/Users/xxx

USER_LIBRARY_DIR:/Users/xxx/Library

你可能感兴趣的:(Xcode环境变量备忘)