Xcode的环境变量

http://stackoverflow.com/questions/6910901/canonical-list-of-xcode-environment-variables

Variable Example
PATH “/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
LANG en_US.US-ASCII
IPHONEOS_DEPLOYMENT_TARGET 4.1
ACTION build
AD_HOC_CODE_SIGNING_ALLOWED NO
ALTERNATE_GROUP staff
ALTERNATE_MODE u+w,go-w,a+rX
ALTERNATE_OWNER username
ALWAYS_SEARCH_USER_PATHS YES
APPLE_INTERNAL_DEVELOPER_DIR /AppleInternal/Developer
APPLE_INTERNAL_DIR /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR /AppleInternal/Documentation
APPLE_INTERNAL_LIBRARY_DIR /AppleInternal/Library
APPLE_INTERNAL_TOOLS /AppleInternal/Developer/Tools
APPLY_RULES_IN_COPY_FILES NO
ARCHS “armv6
ARCHS_STANDARD_32_64_BIT “armv6
ARCHS_STANDARD_32_BIT “armv6
ARCHS_UNIVERSAL_IPHONE_OS armv7
AVAILABLE_PLATFORMS “iphonesimulator
BUILD_COMPONENTS “headers
BUILD_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
BUILD_ROOT “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
BUILD_STYLE
BUILD_VARIANTS normal
BUILT_PRODUCTS_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
CACHE_ROOT /var/folders/2x/rvb2r9s16mq6r318zxvn0lk80000gn/C/com.apple.Xcode.501
CCHROOT /var/folders/2x/rvb2r9s16mq6r318zxvn0lk80000gn/C/com.apple.Xcode.501
CHMOD /bin/chmod
CHOWN /usr/sbin/chown
CLASS_FILE_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
CLEAN_PRECOMPS YES
CLONE_HEADERS NO
CODESIGNING_FOLDER_PATH “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
CODE_SIGNING_ALLOWED YES
CODE_SIGNING_REQUIRED YES
CODE_SIGN_CONTEXT_CLASS XCiPhoneOSCodeSignContext
CODE_SIGN_IDENTITY “iPhone
COMBINE_HIDPI_IMAGES NO
COMPOSITE_SDK_DIRS /var/folders/2x/rvb2r9s16mq6r318zxvn0lk80000gn/C/com.apple.Xcode.501/CompositeSDKs
COMPRESS_PNG_FILES YES
CONFIGURATION Distribution
CONFIGURATION_BUILD_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
CONFIGURATION_TEMP_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
CONTENTS_FOLDER_PATH project.app/Contents
COPYING_PRESERVES_HFS_DATA NO
COPY_PHASE_STRIP YES
COPY_RESOURCES_FROM_STATIC_FRAMEWORKS YES
CP /bin/cp
CURRENT_ARCH armv7
CURRENT_VARIANT normal
DEAD_CODE_STRIPPING YES
DEBUGGING_SYMBOLS YES
DEBUG_INFORMATION_FORMAT dwarf-with-dsym
DEPLOYMENT_LOCATION YES
DEPLOYMENT_POSTPROCESSING YES
DERIVED_FILES_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
DERIVED_FILE_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
DERIVED_SOURCES_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
DEVELOPER_APPLICATIONS_DIR /Developer/Applications
DEVELOPER_BIN_DIR /Developer/usr/bin
DEVELOPER_DIR /Developer
DEVELOPER_FRAMEWORKS_DIR /Developer/Library/Frameworks
DEVELOPER_FRAMEWORKS_DIR_QUOTED “\”/Developer/Library/Frameworks\””
DEVELOPER_LIBRARY_DIR /Developer/Library
DEVELOPER_SDK_DIR /Developer/SDKs
DEVELOPER_TOOLS_DIR /Developer/Tools
DEVELOPER_USR_DIR /Developer/usr
DEVELOPMENT_LANGUAGE English
DOCUMENTATION_FOLDER_PATH project.app/English.lproj/Documentation
DO_HEADER_SCANNING_IN_JAM NO
DSTROOT “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
DWARF_DSYM_FILE_NAME project.app.dSYM
DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT NO
DWARF_DSYM_FOLDER_PATH “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
EFFECTIVE_PLATFORM_NAME -iphoneos
EMBEDDED_PROFILE_NAME embedded.mobileprovision
ENABLE_HEADER_DEPENDENCIES YES
ENABLE_OPENMP_SUPPORT NO
ENTITLEMENTS_ALLOWED YES
ENTITLEMENTS_REQUIRED YES
EXCLUDED_INSTALLSRC_SUBDIRECTORY_PATTERNS “.svn
EXECUTABLES_FOLDER_PATH project.app/Executables
EXECUTABLE_FOLDER_PATH project.app
EXECUTABLE_NAME project
EXECUTABLE_PATH project.app/project
FILE_LIST “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
FIXED_FILES_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
FRAMEWORKS_FOLDER_PATH project.app/Frameworks
FRAMEWORK_FLAG_PREFIX -framework
FRAMEWORK_SEARCH_PATHS “\”/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
FRAMEWORK_VERSION A
FULL_PRODUCT_NAME project.app
GCC3_VERSION 3.3
GCC_C_LANGUAGE_STANDARD gnu99
GCC_INLINES_ARE_PRIVATE_EXTERN YES
GCC_PFE_FILE_C_DIALECTS “c
GCC_PRECOMPILE_PREFIX_HEADER YES
GCC_PREFIX_HEADER project/Prefix.pch
GCC_PREPROCESSOR_DEFINITIONS “NDEBUG
GCC_SYMBOLS_PRIVATE_EXTERN YES
GCC_THUMB_SUPPORT YES
GCC_TREAT_WARNINGS_AS_ERRORS NO
GCC_VERSION com.apple.compilers.llvm.clang.1_0
GCC_VERSION_IDENTIFIER com_apple_compilers_llvm_clang_1_0
GCC_WARN_ABOUT_RETURN_TYPE YES
GCC_WARN_UNUSED_FUNCTION YES
GCC_WARN_UNUSED_VARIABLE YES
GENERATE_MASTER_OBJECT_FILE NO
GENERATE_PKGINFO_FILE YES
GENERATE_PROFILING_CODE NO
GID 20
GROUP staff
INPUT_FILE_BASE Default
INPUT_FILE_DIR “/Volumes/Development/Project
INPUT_FILE_NAME Default.png
INPUT_FILE_PATH “/Volumes/Development/Project
SCRIPT_INPUT_FILE “/Volumes/Development/Project
SCRIPT_OUTPUT_FILE_0 “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES “*.nib
HEADERMAP_INCLUDES_FLAT_ENTRIES_FOR_TARGET_BEING_BUILT YES
HEADERMAP_INCLUDES_FRAMEWORK_ENTRIES_FOR_ALL_PRODUCT_TYPES YES
HEADERMAP_INCLUDES_NONPUBLIC_NONPRIVATE_HEADERS YES
HEADERMAP_INCLUDES_PROJECT_HEADERS YES
HEADER_SEARCH_PATHS “\”/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
ICONV /usr/bin/iconv
INFOPLIST_EXPAND_BUILD_SETTINGS YES
INFOPLIST_FILE project/Resources/Info.plist
INFOPLIST_OUTPUT_FORMAT binary
INFOPLIST_PATH project.app/Info.plist
INFOPLIST_PREPROCESS NO
INFOSTRINGS_PATH project.app/English.lproj/InfoPlist.strings
INPUT_FILE_REGION_PATH_COMPONENT
INPUT_FILE_SUFFIX .png
INSTALL_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
INSTALL_GROUP staff
INSTALL_MODE_FLAG u+w,go-w,a+rX
INSTALL_OWNER username
INSTALL_PATH /Applications
INSTALL_ROOT “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
JAVAC_DEFAULT_FLAGS “-J-Xms64m
JAVA_APP_STUB /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub
JAVA_ARCHIVE_CLASSES YES
JAVA_ARCHIVE_TYPE JAR
JAVA_COMPILER /usr/bin/javac
JAVA_FOLDER_PATH project.app/Java
JAVA_FRAMEWORK_RESOURCES_DIRS Resources
JAVA_JAR_FLAGS cv
JAVA_SOURCE_SUBDIR .
JAVA_USE_DEPENDENCIES YES
JAVA_ZIP_FLAGS -urg
JIKES_DEFAULT_FLAGS “+E
KEEP_PRIVATE_EXTERNS NO
LD_GENERATE_MAP_FILE NO
LD_MAP_FILE_PATH “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
LD_NO_PIE NO
LD_OPENMP_FLAGS -fopenmp
LEGACY_DEVELOPER_DIR /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer
LEX /Developer/usr/bin/lex
LIBRARY_FLAG_NOSPACE YES
LIBRARY_FLAG_PREFIX -l
LIBRARY_SEARCH_PATHS “\”/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
LINKER_DISPLAYS_MANGLED_NAMES NO
LINK_FILE_LIST_normal_armv6 “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
LINK_FILE_LIST_normal_armv7 “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
LINK_WITH_STANDARD_LIBRARIES YES
LOCALIZED_RESOURCES_FOLDER_PATH project.app/English.lproj
LOCAL_ADMIN_APPS_DIR /Applications/Utilities
LOCAL_APPS_DIR /Applications
LOCAL_DEVELOPER_DIR /Library/Developer
LOCAL_LIBRARY_DIR /Library
MACH_O_TYPE mh_execute
MAC_OS_X_PRODUCT_BUILD_VERSION 11A511
MAC_OS_X_VERSION_ACTUAL 1070
MAC_OS_X_VERSION_MAJOR 1070
MAC_OS_X_VERSION_MINOR 0700
NATIVE_ARCH armv6
NATIVE_ARCH_32_BIT i386
NATIVE_ARCH_64_BIT x86_64
NATIVE_ARCH_ACTUAL x86_64
NO_COMMON YES
OBJECT_FILE_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
OBJECT_FILE_DIR_normal “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
OBJROOT “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
ONLY_ACTIVE_ARCH NO
OPTIMIZATION_LEVEL 0
OS MACOS
OSAC /usr/bin/osacompile
OTHER_CFLAGS -DNS_BLOCK_ASSERTIONS=1
OTHER_CPLUSPLUSFLAGS -DNS_BLOCK_ASSERTIONS=1
OTHER_INPUT_FILE_FLAGS
OTHER_LDFLAGS -lz
PACKAGE_TYPE com.apple.package-type.wrapper.application
PASCAL_STRINGS YES
PATH_PREFIXES_EXCLUDED_FROM_HEADER_DEPENDENCIES “/usr/include
PBDEVELOPMENTPLIST_PATH project.app/pbdevelopment.plist
PFE_FILE_C_DIALECTS “c
PKGINFO_FILE_PATH “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
PKGINFO_PATH project.app/PkgInfo
PLATFORM_DEVELOPER_APPLICATIONS_DIR /Developer/Platforms/iPhoneOS.platform/Developer/Applications
PLATFORM_DEVELOPER_BIN_DIR /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
PLATFORM_DEVELOPER_LIBRARY_DIR /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library
PLATFORM_DEVELOPER_SDK_DIR /Developer/Platforms/iPhoneOS.platform/Developer/SDKs
PLATFORM_DEVELOPER_TOOLS_DIR /Developer/Platforms/iPhoneOS.platform/Developer/Tools
PLATFORM_DEVELOPER_USR_DIR /Developer/Platforms/iPhoneOS.platform/Developer/usr
PLATFORM_DIR /Developer/Platforms/iPhoneOS.platform
PLATFORM_NAME iphoneos
PLATFORM_PREFERRED_ARCH i386
PLATFORM_PRODUCT_BUILD_VERSION 8H7
PLIST_FILE_OUTPUT_FORMAT binary
PLUGINS_FOLDER_PATH project.app/PlugIns
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR YES
PRECOMP_DESTINATION_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
PRESERVE_DEAD_CODE_INITS_AND_TERMS NO
PRIVATE_HEADERS_FOLDER_PATH project.app/PrivateHeaders
PRODUCT_NAME project
PRODUCT_SETTINGS_PATH “/Volumes/Development/Project
PRODUCT_TYPE com.apple.product-type.application
PROFILING_CODE NO
PROJECT project
PROJECT_DERIVED_FILE_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
PROJECT_DIR “/Volumes/Development/Project
PROJECT_FILE_PATH “/Volumes/Development/Project
PROJECT_NAME project
PROJECT_TEMP_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
PROVISIONING_PROFILE_REQUIRED YES
PUBLIC_HEADERS_FOLDER_PATH project.app/Headers
RECURSIVE_SEARCH_PATHS_FOLLOW_SYMLINKS YES
REMOVE_CVS_FROM_RESOURCES YES
REMOVE_GIT_FROM_RESOURCES YES
REMOVE_SVN_FROM_RESOURCES YES
RESOURCE_RULES_REQUIRED YES
REZ_COLLECTOR_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
REZ_OBJECTS_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
REZ_SEARCH_PATHS “\”/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
RUN_CLANG_STATIC_ANALYZER NO
SCAN_ALL_SOURCE_FILES_FOR_INCLUDES NO
SCRIPTS_FOLDER_PATH project.app/Scripts
SCRIPT_INPUT_FILE “/Volumes/Development/Project
SCRIPT_OUTPUT_FILE_0 “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
SCRIPT_OUTPUT_FILE_COUNT 1
SDKROOT /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
SDK_DIR /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
SDK_NAME iphoneos4.3
SDK_PRODUCT_BUILD_VERSION 8H7
SED /usr/bin/sed
SEPARATE_STRIP NO
SEPARATE_SYMBOL_EDIT NO
SET_DIR_MODE_OWNER_GROUP YES
SET_FILE_MODE_OWNER_GROUP NO
SHALLOW_BUNDLE YES
SHARED_DERIVED_FILE_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
SHARED_FRAMEWORKS_FOLDER_PATH project.app/SharedFrameworks
SHARED_PRECOMPS_DIR /Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/Build/PrecompiledHeaders
SHARED_SUPPORT_FOLDER_PATH project.app/SharedSupport
SKIP_INSTALL NO
SOURCE_ROOT “/Volumes/Development/Project
SRCROOT “/Volumes/Development/Project
STRINGS_FILE_OUTPUT_ENCODING binary
STRIP_INSTALLED_PRODUCT YES
STRIP_STYLE all
SUPPORTED_DEVICE_FAMILIES 1,2
SUPPORTED_PLATFORMS “iphonesimulator
SYMROOT “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
SYSTEM_ADMIN_APPS_DIR /Applications/Utilities
SYSTEM_APPS_DIR /Applications
SYSTEM_CORE_SERVICES_DIR /System/Library/CoreServices
SYSTEM_DEMOS_DIR /Applications/Extras
SYSTEM_DEVELOPER_APPS_DIR /Developer/Applications
SYSTEM_DEVELOPER_BIN_DIR /Developer/usr/bin
SYSTEM_DEVELOPER_DEMOS_DIR “/Developer/Applications/Utilities/Built
SYSTEM_DEVELOPER_DIR /Developer
SYSTEM_DEVELOPER_DOC_DIR “/Developer/ADC
SYSTEM_DEVELOPER_GRAPHICS_TOOLS_DIR “/Developer/Applications/Graphics
SYSTEM_DEVELOPER_JAVA_TOOLS_DIR “/Developer/Applications/Java
SYSTEM_DEVELOPER_PERFORMANCE_TOOLS_DIR “/Developer/Applications/Performance
SYSTEM_DEVELOPER_RELEASENOTES_DIR “/Developer/ADC
SYSTEM_DEVELOPER_TOOLS /Developer/Tools
SYSTEM_DEVELOPER_TOOLS_DOC_DIR “/Developer/ADC
SYSTEM_DEVELOPER_TOOLS_RELEASENOTES_DIR “/Developer/ADC
SYSTEM_DEVELOPER_USR_DIR /Developer/usr
SYSTEM_DEVELOPER_UTILITIES_DIR /Developer/Applications/Utilities
SYSTEM_DOCUMENTATION_DIR /Library/Documentation
SYSTEM_LIBRARY_DIR /System/Library
TARGETED_DEVICE_FAMILY 1
TARGETNAME Project
TARGET_BUILD_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
TARGET_NAME Project
TARGET_TEMP_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
TEMP_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
TEMP_FILES_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
TEMP_FILE_DIR “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
TEMP_ROOT “/Users/username/Library/Developer/Xcode/DerivedData/project-dxdgjvgsvvbhowgjqouevhmvgxgf/ArchiveIntermediates/Project
TEST_AFTER_BUILD NO
UID 501
UNLOCALIZED_RESOURCES_FOLDER_PATH project.app
USER username
USER_APPS_DIR /Users/username/Applications
USER_HEADER_SEARCH_PATHS project/libs
USER_LIBRARY_DIR /Users/username/Library
USE_DYNAMIC_NO_PIC YES
USE_HEADERMAP YES
USE_HEADER_SYMLINKS NO
VALIDATE_PRODUCT YES
VALID_ARCHS “armv6
VERBOSE_PBXCP NO
VERSIONPLIST_PATH project.app/version.plist
VERSION_INFO_BUILDER username
VERSION_INFO_FILE project_vers.c
VERSION_INFO_STRING “\”@(#)PROGRAM:project
WRAPPER_EXTENSION app
WRAPPER_NAME project.app
WRAPPER_SUFFIX .app
XCODE_APP_SUPPORT_DIR /Developer/Library/Xcode
XCODE_PRODUCT_BUILD_VERSION 4B110
XCODE_VERSION_ACTUAL 0410
XCODE_VERSION_MAJOR 0400
XCODE_VERSION_MINOR 0410
YACC /Developer/usr/bin/yacc

Mac OS X 网络限速方法

开发中经常需要限制网格速度来进行一些调试,此时可以用ipfw来配置网络带宽来达到限速的目的

sudo ipfw add pipe 1 ip from any 80 to any via en0

这里的两个any可以根据实际情况来配置要做限制的ip段 后面80是端口 en0为网络接口

sudo ipfw pipe 1 config bandwidth 30Kbyte/s

这里30Kbyte/s为要限制的带宽,unlimited为不限速,再次执行这行命令可以修改要限制的带宽

 

另有图形化工具一枚 http://www.hanynet.com/waterroof/index.html

 

在linux 中可以使用 iptables

iptables -A FORWARD -m limit -s 61.155.141.16 –limit  700/s -j ACCEPT

iptables -A FORWARD -s 61.155.141.16 -j DROP

 

 

(CoreData) 如何高效地导入数据

Efficiently Importing Data

这篇文章讲述了如何更有效率地导入数据到Core Data应用并将数据转换为managed objects以持久化。并讨论了一些应该遵从的Cocoa基本模式,和一些专用于Core Data中的模式

Cocoa Fundamentals

一般说来,当你使用Core Data来导入数据文件时一定要记住一个在Cocoa 应用开发中需要应用的很重要的“一般规则”。如果你导入文件必须以某种方式解析时,这一般需要使用大量的临时文件。这会导致大量的内存占用甚至引起内存分页。就像没有使用Core Data的应用时会做的一样,你可以使用本地的自动释放池block来控制在内存存在对象数量。关于更多的Core Data与内存管理的交互参见 “Reducing Memory Overhead.”

你同时应该减少不必要的重复工作。在创建一个包含一个变量的predicate中有一个微妙的例子。如果像下面这样创建predicate里,你不仅仅是在每一个多循环都创建了一个predicate, 还同时在做解析。

// Loop over employeeIDs.
for (NSString *anID in employeeIDs) {
    NSString *predicateString = [NSString stringWithFormat:@"employeeID == %@", anID];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateString];

为了从一个格式化的字符串中创建一个predicate, 框架必须解析这个字符串并创建一predicate的实例和一堆表达式对象。如果能使用同一个predicate对象,如果你是在重复使用同一种格式的predicate,只是在每次循环中改变表达式中的常量,你可以创建一个predicate的实例,然后每次再替换里面的常量 (参见 “Creating Predicates”),这样会更有效率. 这种技术如下面的代码所示。

NSString *predicateString = [NSString stringWithFormat @"employeeID == $EMPLOYEE_ID"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateString];
for (NSString *anID in employeeIDs) {
    NSDictionary *variables = @{ @"EMPLOYEE_ID" : anID };
    NSPredicate *localPredicate = [predicate predicateWithSubstitutionVariables:variables];

Reducing Peak Memory Footprint

如果你需要导入大量的数据到Core Data应用中, 你应该批量导入这些数据并在批次间清理Core Data栈以保证降低应用的内存使用峰值。相关的案例与技术参见 “Core Data Performance” (特别是 “Reducing Memory Overhead”) 与 “Object Lifetime Management,” 方便起见这里总结了这些这些技术。

Importing in batches

首先,应该为导入创建多个分开的托管对象上Contexts,然后设置它们的undo manager为nil。 (Contexts 的创建并不是很耗资源,所以如果你缓存了 persistent store coordinator 你可以为了不同的工作集或特殊的操作使用不过的Contexts。)

NSManagedObjectContext *importContext = [[NSManagedObjectContext alloc] init];
NSPersistentStoreCoordinator *coordinator = <#Get the coordinator#>;
[importContext setPersistentStoreCoordinator:coordinator];
[importContext setUndoManager:nil];

(如你以有一个创建好的 Core Data 栈, 你可以从另外一个托管对象的context中获取 persistent store coordinator .) 设置undo manager 为 nil 意味着:

  1. 你不会把努力浪费在记录对不需要撤销的动作上(如插入);

  2. Undo manager 不会强引用被改变的对象以阻止他们被释放  (参见 “Change and Undo Management”).

你应该在分批导入数据差创建相应的托管对象 (最优的批次大小取决于每条记录的多大和你相要保持多低的内存占用). 在一个自动释放块中进行每一个批次的处理; 在每一个批量操之后你需要保存context (调用 save:). (直到保存前,context会对每一个未保存的改变保持强引用完成插入操作.)

Dealing with strong reference cycles

相互有引用的托管对象几互每次都会导致不可恢复的强引用环. 如果在导入中你在对象中创建了引用关系,你需要打破这个环来让对象在不再使用时得以析构。为了完成这个目标, you can either turn the objects into faults, or reset the whole context. 完整的讨论, 参见 “Breaking Relationship Strong Reference Cycles.”

Implementing Find-or-Create Efficiently

在导入数据中一个常用的技术是使用“查找或新增”模式, 来判断一个对象是否己经存在,如果没有则创建它。

为了一堆离散的值,在需要寻找己有对象(己经持久化)时你可能会遇到很多种情况. 一个简单的方法是创建一个循环, 然后对每一个值执行一次查询来判断是否己经存在一个匹配的对象. 这个模式不是很好。如果你分析使用这种模式的应用,你会发现每一次查询是在循环中最耗时的操作之一(相对于仅仅枚举集合中的每一个对象). 甚至这个模式会将问题的时间复杂度由 O(n) 变为 O(n^2)。

在可能的情况下有一个很高效的方法,一次性地创建所有托管对象,然后再修复对象间的关系。比如你导入的数据中不存在任何重复的数据(比如说你的初始集为空),你可以直接创建对应的托管对象而不用进行查询,或者你导入一个“展平”的数据,它们之音没有任何关联. 你可以先创建所有对应的托管对象,然后在保存前用一个大的 IN predicate来干掉重复的对象.

如果说你因为要导入一堆使用属相来相互关联的数据,在使用“查找或创建”模式时,你可以能过减少查询次数来优化查找己有对象的方式。完成这种方法取决于过程中有多少参考数据必须使用。如果你导入100个潜在的新对象,但在数据库中只有2000条数据,从数据库中取出所有的数据并缓存起来不会太蛋疼(特别是这些数据会反复用到)。但是如果你有 100,000 条数据在库中,把它们在内存中缓存起来就糟心了。

你可以在每个查询中组合使用IN predicate 和排序来减少 Core Data 的工作量. 举个例子,说你希望获先取得一个雇员ID(string类型)的列表, 然后再创建所有不在库中的雇员,or example, you want to take a list of employee IDs (as strings) and create Employee records for all those not already in the database. 考虑这段代码,雇员是一个有着 name 属性的实体, 一个 listOfIDsAsString 是一张雇员 ID 的表, 这里面的雇员如果没在库中的话你想把他们加入库中。

第一步,对相关的对象分离ID并排序

// get the names to parse in sorted order
NSArray *employeeIDs = [[listOfIDsAsString componentsSeparatedByString:@"\n"]
        sortedArrayUsingSelector: @selector(compare:)];

下一步,用 IN 名字字符串数 创建一个 predicate, 附带上一个排序描述来保证结果与名字的顺序一致. (IN 与 SQL中 IN 的操作一样, 都是判断左边的值一定会在右边的集合中出现.)

// Create the fetch request to get all Employees matching the IDs.
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:
        [NSEntityDescription entityForName:@"Employee" inManagedObjectContext:aMOC]];
[fetchRequest setPredicate: [NSPredicate predicateWithFormat:@"(employeeID IN %@)", employeeIDs]];
// make sure the results are sorted as well
[fetchRequest setSortDescriptors:
        @[[[NSSortDescriptor alloc] initWithKey: @"employeeID" ascending:YES]]];

最后执行查询.

NSError *error;
NSArray *employeesMatchingNames = [aMOC executeFetchRequest:fetchRequest error:&error];

你会得到两个排序好的数组,一个里面有通查询的雇员ID,一个里面有对应的托管对象. 为了处理它们,可以用以下步聚遍历这两个数组:

  1. 取下一个 ID 和 雇员. 如果 ID 与  雇员 ID 不匹配, 创建一个与这个ID对应的新雇员。

  2. 取下一个雇员: 如果这个雇员的ID与刚才取到的ID匹配, 取下一个 ID 和 雇员.

不管你有多少个 ID 要处理, 你只需要一次查询,然后处理结果集即可。

下面的代码完整展示了上一段的例子。

// Get the names to parse in sorted order.
NSArray *employeeIDs = [[listOfIDsAsString componentsSeparatedByString:@"\n"]
        sortedArrayUsingSelector: @selector(compare:)];
// create the fetch request to get all Employees matching the IDs
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:
        [NSEntityDescription entityForName:@"Employee" inManagedObjectContext:aMOC]];
[fetchRequest setPredicate: [NSPredicate predicateWithFormat: @"(employeeID IN %@)", employeeIDs]];
// Make sure the results are sorted as well.
[fetchRequest setSortDescriptors:
    @[ [[NSSortDescriptor alloc] initWithKey: @"employeeID" ascending:YES] ]];
// Execute the fetch.
NSError *error;
NSArray *employeesMatchingNames = [aMOC executeFetchRequest:fetchRequest error:&error];

 

http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/coredata/Articles/cdImporting.html#//apple_ref/doc/uid/TP40003174-SW4

查看剩余内存

#import <mach/mach.h>
#import <mach/mach_host.h>

void print_free_memory ()
{
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;

host_port = mach_host_self();
host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);
host_page_size(host_port, &pagesize);

vm_statistics_data_t vm_stat;

if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size) != KERN_SUCCESS)
NSLog(@"Failed to fetch vm statistics");

/* Stats in bytes */
natural_t mem_used = (vm_stat.active_count +
vm_stat.inactive_count +
vm_stat.wire_count) * pagesize;
natural_t mem_free = vm_stat.free_count * pagesize;
natural_t mem_total = mem_used + mem_free;
NSLog(@"used: %u free: %u total: %u", mem_used, mem_free, mem_total);
}

http://stackoverflow.com/questions/10648902/how-to-get-available-memory-in-ios

解决Mac关机慢的问题

安装华为的3G上网卡会导致Mac OS X 关机特别的慢
可以删除/Library/StartupItems 中 HWNetManager HWPortDetect StartOuc 这三个文件夹可以恢复正常的关机 并不影响上网卡的正常使用
如果还没有解决可以参考 http://blog.csdn.net/afatgoat/article/details/8293224

refs:
http://blog.csdn.net/afatgoat/article/details/8293224
http://bbs.weiphone.com/read-htm-tid-2730321.html