在Xcode 中 Run 和 build 和 run区别的区别

XCode环境变量及路径设置
XCode环境变量及路径设置
分类: Objective-C 12:30 41336人 评论(1) 收藏 举报 一般我们在xcode里面配置包含工程目录下头文件的时候,都要关联着相对路径和绝对路径,如果只是自己用这个项目,用绝对路径的问题不大,但是如果你把工程发给别人,别人就要在改这个绝对路径,这时候绝对路径的缺点立马出现。
所以在修改User Header Search Paths这个选项的时候使用
&$(SRCROOT)/当前工程名字/需要包含头文件所在文件夹&
将上面的双引号里面的字符串拷贝之后,你会发现这个&$(SRCROOT)&,会自动变成当前工程所以的目录。
这样就可以了,发给别人,别人也不用在去修改路径了。
xcode4的环境变量,Build Settings参数,workspace及联编设置
一、xcode4中的环境变量
$(BUILT_PRODUCTS_DIR)
build成功后的,最终产品路径--可以在Build Settings参数的Per-configuration Build Products Path项里设置
$(TARGET_NAME)
目标工程名称
$(SRCROOT)
工程文件(比如Nuno.xcodeproj)的路径
$(CURRENT_PROJECT_VERSION)
当前工程版本号
当编译静态库,设备选模拟器(iPhone 5.0 Simulator),未设置任何Build Settings参数时,默认的基础路径:
/Users/xxx/Library/Developer/Xcode/DerivedData/xxxWorkspace-caepeadwrerdcrftijaolkkagbjf
下面用$()代替上面一长串东东
$(SYMROOT) = $()/Build/Products
$(BUILD_DIR) = $()/Build/Products
$(BUILD_ROOT) = $()/Build/Products
这三个变量中的$()不会随着Build Settings参数的设置而改变
相反,以下可以通过设置而改变
$(CONFIGURATION_BUILD_DIR) = $()/Build/Products/Debug-iphonesimulator
$(BUILT_PRODUCTS_DIR) = $()/Build/Products/Debug-iphonesimulator
$(CONFIGURATION_TEMP_DIR) = $()/Build/Intermediates/UtilLib.build/Debug-iphonesimulator
$(TARGET_BUILD_DIR) = $()/Build/Products/Debug-iphonesimulator
$(SDK_NAME) = iphonesimulator5.0
$(PLATFORM_NAME) = iphonesimulator
$(CONFIGURATION) = Debug
$(TARGET_NAME) = UtilLib
$(EXECUTABLE_NAME) = libUtilLib.a 可执行文件名
${IPHONEOS_DEPLOYMENT_TARGET} 5.0
$(ACTION) = build
$(CURRENTCONFIG_SIMULATOR_DIR) 当前模拟器路径
$(CURRENTCONFIG_DEVICE_DIR) 当前设备路径
$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME =
$()/Build/Products/Debug-iphonesimulator
$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) = $()/Build/Intermediates/UtilLib.build/Debug-iphonesimulator
自定义变量
${CONFIGURATION}-iphoneos 表示:Debug-iphoneos
${CONFIGURATION}-iphonesimulator 表示:Debug-iphonesimulator
$(CURRENTCONFIG_DEVICE_DIR) = ${SYMROOT}/${CONFIGURATION}-iphoneos
$(CURRENTCONFIG_SIMULATOR_DIR) = ${SYMROOT}/${CONFIGURATION}-iphonesimulator
自定义一个设备无关的路径(用来存放各种架构arm6/arm7/i386输出的产品)
$(CREATING_UNIVERSAL_DIR) = ${SYMROOT}/${CONFIGURATION}-universal
自定义变量代表的值
$(CURRENTCONFIG_DEVICE_DIR) = $()/Build/Products/Debug-iphoneos
$(CURRENTCONFIG_SIMULATOR_DIR) = $()/Build/Products/Debug-iphonesimulator
$(CREATING_UNIVERSAL_DIR) = $()/Build/Products/Debug-universal
iphoneos5.0下的编译脚本:
xcodebuild -project &UtilLib.xcodeproj& -configuration &Debug& -target &UtilLib& -sdk &iphoneos5.0& -arch &armv6 armv7& build RUN_CLANG_STATIC_ANALYZER=NO $(BUILD_DIR)=&${BUILD_DIR}& BUILD_ROOT=&${BUILD_ROOT}&
iphonesimulator5.0下的编译脚本:
xcodebuild -project &UtilLib.xcodeproj& -configuration &Debug& -target &UtilLib& -sdk &iphonesimulator5.0& -arch &i386& build RUN_CLANG_STATIC_ANALYZER=NO $(BUILD_DIR)=&${BUILD_DIR}& BUILD_ROOT=&${BUILD_ROOT}&
加上下面一句表示输出到文件:
& &${BUILD_ROOT}.build_output&
lipo脚本工具:合并iPhone模拟器和真机的静态类库,生成通用库
lipo -create -output &${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}& &${CURRENTCONFIG_DEVICE_DIR}/${EXECUTABLE_NAME}& &${CURRENTCONFIG_SIMULATOR_DIR}/${EXECUTABLE_NAME}&
意思是:把&${CURRENTCONFIG_DEVICE_DIR}目录下的.a文件,和${CURRENTCONFIG_SIMULATOR_DIR}目录下的.a文件合并,
在${CREATING_UNIVERSAL_DIR}目录下,生成两个设备都通用的静态库,
例如:lipo -create -output xy.a x.a y.a
二、xcode4中build Settings常见参数解析
1.Installation Directory:安装路径
静态库编译时,在Build Settings中Installation Directory设置&$(BUILT_PRODUCTS_DIR)&
Skip Install设为YES
Installation Directory默认为/usr/local/lib
因为Build Location默认时,.a文件会放在很长(比如:/Users/xxx/Library/Developer/Xcode/DerivedData/xxxProgram
dalrvzehhtesxdfqhxixzafvddwe/Build/Products/Debug-iPhoneos)的路径下,或是我们target指定的路径
Skip Install如果是NO,可能会被安装到默认路径/usr/local/lib
2.Public Headers Folder Path:对外公开头文件路径
设为&include&(具体的头文件路径为:$(BUILT_PRODUCTS_DIR)/include/xx.h)
在最终文件.a同级目录下生成一个include目录
默认:/usr/local/include
Public Headers Folder Path这个路径就是使用这lib的某工程需要依赖的外部头文件.导入这路径后,#include/import &xx.h&才能看到
3.User Header Search Paths:依赖的外部头文件搜索路径
设置为&$(BUILT_PRODUCTS_DIR)/include&
和2中路径对应
4.Per-configuration Build Products Path:最终文件路径
比如设为&../app&,就会在工程文件.xcodeproj上一层目录下的app目录里,创建最终文件
默认为$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
等于$(BUILT_PRODUCTS_DIR)
5.Per-configuration Intermediate Build Files Path:临时中间文件路径
默认为:$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6.Code Signing Identity:真机调试的证书选择
选一个和Bundle identifier相对应的证书
Library Search Paths:库搜索路径
Architectures:架构,设为 armv6 或 armv7
Valid Architectures:应用框架,可以设为 armv6、 armv7 或i386
Product Name:工程文件名,默认为$(TARGET_NAME)
Info.plist File:info文件路径
Build Variants:默认为normal
Other Linker Flags:其他链接标签
设为&-ObjC&
当导入的静态库使用了类别,需要设为-ObjC
iOS Deployment Target:ios部署对象
比如可以选择设为,ios3到ios5的一种版本
Prefix Header:预编头文件(比如:UtilLib/UtilLib-Prefix.pch)
Precompile Prefix Header:设为&Yes&,表示允许加入预编译头
三、workspace(工作区)
作用:管理多个工程(project),多工程联编
四、workspace多工程联编设置
1.新建一个静态库工程,比如UtilLib,并生成UtilLib.h和UtilLib.m文件
2.选中需要公开的头文件,
把右侧栏的Target Membership中设置为public
或则,选中工程目录target的Build Phases标签的copy headers项,在public中添加要公开的头文件
3.Architectures设为:armv6 armv7
4.Valid Architectures设为:armv6 armv7 i386
5.Build Products Path设为:$(SRCROOT)/../build
6.Per-configuration Build Products Path设为:
$(SRCROOT)/../build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7.Per-configuration Intermediate Build Files Path设为:
$(SRCROOT)/../build/$(TARGET_NAME).build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8.设置安装路径:Installation Directory项
9.设置对外公开的头文件路径:Public Headers Folder Path项
10.为静态库添加依赖的shell脚本
选中工程目录target的Build Phases标签,点击由下角的Add Build Phase按钮
在弹出的菜单里选择Add run script项,然后页面中会多出一个Run Script项
在黑框里填写&$SRCROOT/mergeArmSymbols.sh&
建立对此脚本的依赖(编译静态库的后会运行此脚本)
如果编译时设备选的是iphone simulator:
则此脚本会在对应iphone device的产品目录Debug-iphoneos中,生成对device有用的.a静态库,
相反,如果设备选的是iphone device:
则此脚本会在对应iphone simulator的产品目录Debug-iphoneos中,生成对simulator有用的.a静态库
最后,此脚本调用lipo工具,把本工程生成静态库与此脚本生成的静态库合并,生成simulator和device都通用的.a文件
11.具体bash shell脚本如下:
[plain] view plaincopy
mergeArmSymbols.sh
# Version 2.0 (updated for Xcode 4, with some fixes)
# Author: Adam Martin - /redglassesapps
# Based on: original script from Eonil (main changes: Eonil's script WILL NOT WORK in Xcode GUI - it WILL CRASH YOUR COMPUTER)
# More info: see this Stack Overflow question: /questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#################[ Tests: helps workaround any future bugs in Xcode ]########
DEBUG_THIS_SCRIPT=&true&
if [ $DEBUG_THIS_SCRIPT = &true& ]
echo &########### TESTS #############&
echo &Use the following variables when d note that they may change on recursions&
echo &BUILD_DIR = $BUILD_DIR&
echo &BUILD_ROOT = $BUILD_ROOT&
echo &CONFIGURATION_BUILD_DIR = $CONFIGURATION_BUILD_DIR&
echo &BUILT_PRODUCTS_DIR = $BUILT_PRODUCTS_DIR&
echo &CONFIGURATION_TEMP_DIR = $CONFIGURATION_TEMP_DIR&
echo &TARGET_BUILD_DIR = $TARGET_BUILD_DIR&
echo &SDK_NAME = $SDK_NAME&
echo &PLATFORM_NAME = $PLATFORM_NAME&
echo &CONFIGURATION = $CONFIGURATION&
echo &TARGET_NAME = $TARGET_NAME&
echo &ARCH_TO_BUILD = $ARCH_TO_BUILD&
echo &ARCH_TO_BUILD = $ARCH_TO_BUILD&
echo &ACTION = $ACTION&
echo &SYMROOT = $SYMROOT&
echo &EXECUTABLE_NAME = $EXECUTABLE_NAME&
echo &CURRENTCONFIG_SIMULATOR_DIR = $CURRENTCONFIG_SIMULATOR_DIR&
echo &CURRENTCONFIG_DEVICE_DIR = $CURRENTCONFIG_DEVICE_DIR&
echo &#############Other###########&
echo &BUILD_DIR/CONFIGURATION/EFFECTIVE_PLATFORM_NAME = $BUILD_DIR/$CONFIGURATION$EFFECTIVE_PLATFORM_NAME&
echo &PROJECT_TEMP_DIR/CONFIGURATION/EFFECTIVE_PLATFORM_NAME = $PROJECT_TEMP_DIR/$CONFIGURATION$EFFECTIVE_PLATFORM_NAME&
#####################[ part 1 ]##################
# First, work out the BASESDK version number
# (incidental: searching for substrings in sh is a nightmare! Sob)
SDK_VERSION=$(echo ${SDK_NAME} | grep -o '.\{3\}$')
# Next, work out if we're in SIM or DEVICE
if [ ${PLATFORM_NAME} = &iphonesimulator& ]
OTHER_SDK_TO_BUILD=iphoneos${SDK_VERSION}
ARCH_TO_BUILD=&armv6 armv7&
OTHER_SDK_TO_BUILD=iphonesimulator${SDK_VERSION}
ARCH_TO_BUILD=&i386&
echo &XCode has selected SDK: ${PLATFORM_NAME} with version: ${SDK_VERSION} (although back-targetting: ${IPHONEOS_DEPLOYMENT_TARGET})&
echo &...therefore, OTHER_SDK_TO_BUILD = ${OTHER_SDK_TO_BUILD}&
#####################[ end of part 1 ]##################
#####################[ part 2 ]##################
# IF this is the original invocation, invoke whatever other builds are required
# Xcode is already building ONE target... build ONLY the missing platforms/configurations.
if [ &true& == ${ALREADYINVOKED:-false} ]
echo &RECURSION: Not the root invocation, don't recurse&
# Prevent recursion
export ALREADYINVOKED=&true&
echo &RECURSION: I am the root... recursing all missing build targets...&
echo &RECURSION: ...about to invoke: xcodebuild -configuration \&${CONFIGURATION}\& -target \&${TARGET_NAME}\& -sdk \&${OTHER_SDK_TO_BUILD}\& -arch \&${ARCH_TO_BUILD}\& ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO&
xcodebuild -project &${TARGET_NAME}.xcodeproj& -configuration &${CONFIGURATION}& -target &${TARGET_NAME}& -sdk &${OTHER_SDK_TO_BUILD}& -arch &${ARCH_TO_BUILD}& ${ACTION} RUN_CLANG_STATIC_ANALYZER=NO BUILD_DIR=&${BUILD_DIR}& BUILD_ROOT=&${BUILD_ROOT}& & &${BUILD_ROOT}.build_output&
ACTION=&build&
# Merge all platform binaries as a fat binary for each configurations.
# Calculate where the (multiple) built files are coming from:
CURRENTCONFIG_DEVICE_DIR=${SRCROOT}/../build/${CONFIGURATION}-iphoneos
CURRENTCONFIG_SIMULATOR_DIR=${SRCROOT}/../build/${CONFIGURATION}-iphonesimulator
echo &Taking device build from: ${CURRENTCONFIG_DEVICE_DIR}&
echo &Taking simulator build from: ${CURRENTCONFIG_SIMULATOR_DIR}&
CREATING_UNIVERSAL_DIR=${SRCROOT}/../build/${CONFIGURATION}-universal
echo &...outputing a universal arm6/arm7/i386 build to: ${CREATING_UNIVERSAL_DIR}&
# ... remove the products of previous runs of this script
# NB: this directory is only created by this script - it should be safe to delete
rm -rf &${CREATING_UNIVERSAL_DIR}&
mkdir &${CREATING_UNIVERSAL_DIR}&
echo &lipo: for current configuration (${CONFIGURATION}) creating output file: ${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}&
lipo -create -output &${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}& &${CURRENTCONFIG_DEVICE_DIR}/${EXECUTABLE_NAME}& &${CURRENTCONFIG_SIMULATOR_DIR}/${EXECUTABLE_NAME}&
#######custom########
#copy universal lib to ../libs
libsDir=../libs
includeDir=../include
rm -rf &${libsDir}&
mkdir -p &${libsDir}&
echo &cp -R ${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME} ${libsDir}&
cp -R &${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}& &${libsDir}&
echo &cp -R ${CURRENTCONFIG_DEVICE_DIR}/include ${includeDir}&
cp -R &${CURRENTCONFIG_DEVICE_DIR}/include& &${includeDir}&
下载右边的图片,然后把后缀改为.sh(其实就是上面的脚本,因为博客园只能上传图片)
静态库编译后的目录结构如下:
1.新建主工程,比如Nuno,添加对静态库的依赖
点击工程,在Build Phases标签的Link Binary With Libraries项中点击加号添加UtilLib.a库
选中上面的红色项,在右边栏的Location选Relative to Project,把值设为../libs/libUtilLib.a
2.设置主工程依赖的外部头文件路径:User Header Search Paths项
$(SRCROOT)/../include
3.设置Header Search Paths为:$(SRCROOT)/../include
4.设置Library Search Paths为:$(SRCROOT)/../libs
编译运行即可实现联编
(备注:选择模拟器iphone 5.0 simulator,编译静态库的时,最终文件会在Debug-iphonesimulator,就算成功.a文件还是红色,
这是可能是xcode的bug,不会自动切换路径
因为$(BUILT_PRODUCTS_DIR)所指的位置,是build/Debug-iphonesos,不是包含最终.a文件的Debug-iphonesimulator;
选择ios Device,编译成的最终文件才在build/Debug-iphonesos下,.a文件变成非红色
所有得用mergeArmSymbols.sh脚本来解决)
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467142',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'> 博客详情
**作者:shede333**
**[主页:http://my.oschina.net/shede333](http://my.oschina.net/shede333)**
**版权声明:原创文章,版权声明:自由转载-非商用-非衍生-保持署名 | [Creative Commons BY-NC-ND 3.0][]**
[Creative Commons BY-NC-ND 3.0]:http://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh
##Xcode的Architectures和Valid Architectures的区别
###Architectures
这代表,在这个项目里你想要Xcode编译的目标设备列表。
###Valid Architectures
还不是太明确这个设置的意图,但是一般来说是不需要更改的。
在Xcode5.0里的**Valid Architectures** 设置里,有2个选项:
1. 默认为`standard architectures (including 64-bit)(armv7,armv7s,arm64)`,这样设置,你的**Deployment target**最低只能设置为 6.0,**(在Xcode5.0.1 之后,最低能够兼容IOS 5.1.1)**;
2. `standard architectures (armv7,armv7s)`,这样设置,你的**Deployment target**最低能设置为 4.3;
##原因解释如下:
使用**standard architectures (including 64-bit)(armv7,armv7s,arm64)**参数,
则打的包里面有32位、64位两份代码,
在iPhone5s(`iPhone5s的cpu是64位的`)下,会首选运行64位代码包,
其余的iPhone(`其余iPhone都是32位的,iPhone5c也是32位`),
只能运行32位包,
但是包含两种架构的代码包,只有运行在ios6,ios7系统上。
这也就是说,这种打包方式,对手机几乎没啥要求,但是对系统有要求,即ios6以上。
而使用**standard architectures (armv7,armv7s)**参数,
则打的包里只有32位代码,
iPhone5s的cpu是64位,但是可以兼容32位代码,即可以运行32位代码。但是这会降低iPhone5s的性能,原因下面的参考有解释。
其余的iPhone对32位代码包更没问题,
而32位代码包,对系统也几乎也没什么限制。
所以**总结**如下:
要发挥iPhone5s的64位性能,就要包含64位包,那么系统最低要求为ios6。
如果要兼容ios5以及更低的系统,只能打32位的包,系统都能通用,但是会丧失iPhone5s的性能。
###[所有IOS设备详情列表 List of iOS devices - Wikipedia, the free encyclopedia](http://en.wikipedia.org/wiki/List_of_iOS_devices)
&armv6:iPhone 2G/3G,iPod 1G/2G
&armv7:iPhone 3GS/4/4s,iPod 3G/4G,iPad 1G/2G/3G
,iPad Mini 1
&armv7s:iPhone5 ,iPhone5C ,iPad4
&armv8:iPhone5S
,iPad5(iPad Air), iPad Mini 2(iPad Mini Retina)
###[iOS 7: 如何为iPhone 5S编译64位应用。 ](http://blog.csdn.net/keyboardota/article/details/)
&Xcode 5编译的iOS 7程序包含了32位和64位两套二进制代码,在32位的iOS系统上会调用32位的二进制代码,在64位系统上会调用64位的二进制代码,以此来解决向后兼容的问题。
&同时,考虑到很多32位的程序可能在没有重新编译的情况下部署到64位系统上,64位的iOS系统中带有两套FrameWork,一套是32位的,一套是64位的。
&当64位的iOS系统运行原来的32位程序时,系统会调用32位的FrameWork作为底层支撑,当系统运行64位程序时,系统会调用64位的FrameWork作为底层支撑。
&也就是说,当一个iPhone 5S上同时运行32位程序和64位程序时,系统同时将32位和64位两套FrameWork载入了内存中,所以消耗的内存也比较多。
&如果一台64位的iOS设备上运行的所有程序都是为64位系统编译过的,iOS系统将只载入64位的FrameWork,这将节省好多内存。所以,如果大家都可以快速将程序传换成64位的,iOS将跑得更快。真的是“大家好才是真的好”。
###[What's the difference between “Architectures” and “Valid Architectures” in Xcode Build Settings?](/questions//whats-the-difference-between-architectures-and-valid-architectures-in-xcode)
Architectures are the ones you want to build, valid architectures are the ones you could conceive of building with your codebase.
So maybe you only want to build your binary for armv7s, but the same source code would compile fine for armv7 and armv6. So `VALID_ARCHS = armv6 armv7 armv7s`, but you set `ARCHS = armv7s` because that's all you actually *want* to build with your code.
Or, in Apple-ese:
& ARCHS (Architectures)
& Space-separated list of identifiers. Specifies the architectures (ABIs, processor models) to which the binary is targeted. When this build setting specifies more than one architecture, the generated binary may contain object code for each of the specified architectures.
& VALID_ARCHS (Valid Architectures)
& Space-separated list of identifiers. Specifies the architectures for which the binary may be built. During the build, this list is intersected with the value of ARCHS the resulting list specifies the architectures the binary can run on. If the resulting architecture list is empty, the target generates no binary.
Source: [Xcode Build Setting Reference](/library/ios/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP-CH3-SW51)
In practice, you leave `VALID_ARCHS` alone and don't worry about changing it, and just fiddle with `ARCHS` to set the architectures you want to build. Typically, you set a Debug build to just `NATIVE_ARCH`, since you only want to build the debug version for the machine you'll be testing/running it on, and Release builds for the full spectrum of architectures you plan to support.
###[Xcode 5 and iOS 7: Architecture and Valid architectures](/questions//xcode-5-and-ios-7-architecture-and-valid-architectures)
Set the architecture in build setting to
**_Standard architectures(armv7,armv7s)_**
![enter image description here][41]
[41]: http://i./JYyyn.png
iPhone 5S is powered by A7 64bit processor. From [apple docs](/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/Introduction/Introduction.html)
&Xcode can build your app with both 32-bit and 64-bit binaries included. This combined binary requires a minimum deployment target of iOS 7 or later.
&Note: A future version of Xcode will let you create a single app that supports the 32-bit runtime on iOS 6 and later, and that supports the 64-bit runtime on iOS 7.
From the documentation what i understood is
* Xcode can create both 64bit 32bit binaries for a single app but the
deployment target should be iOS7. They are saying in future it will
be iOS 6.0
* 32 bit binary will work fine in iPhone 5S(64 bit processor).
__Update (Xcode 5.0.1)__
In Xcode 5.0.1 they added the support to create 64 bit binary for iOS 5.1.1 onwards.
&Xcode 5.0.1 can build your app with both 32-bit and 64-bit binaries included. This combined binary requires a minimum deployment target of iOS 5.1.1 or later. The 64-bit binary runs only on 64-bit devices running iOS 7.0.3 and later.
__Update (Xcode 5.1)__
Xcode 5.1 made significant change in the architecture section. This [answer](/questions//how-to-stop-xcode5-1-building-for-64bit/50904) will be a followup for you.
[Check this](/questions//how-to-stop-xcode5-1-building-for-64bit/50904)
###[how to stop xcode5.1 building for 64bit](/questions//how-to-stop-xcode5-1-building-for-64bit/50904)
OP is posted the solution along with the question itself. But I feel it would be better to add it as an answer. In `Xcode 5.1` apple made significant changes to the `architecture` section. They made `arm64` as part of **_Standard architectures_**. That means the projects using the default setting will be automatically build for `arm64` also. So **_what you will do if your app does not support `arm64`?_**.
&Projects not able to support 64-bit need to specifically set the architectures build setting to not include 64-bit.
__How to do that?__
1. Goto Targets--&Build Settings--&Architectures--&Architectures
2. Double click on the architecture will popup a menu. Choose others
![enter image description here][51]
3. Delete the existing row - $(ARCH_STANDARD). Add the required architectures one by one
![enter image description here][52]
4. Now your architecture section will look like this
![enter image description here][53]
[51]: http://i./pIfxB.png
[52]: http://i./ZAKBh.png
[53]: http://i./I0Jb6.png
###1. [Xcode Build Setting Reference (苹果官方文档)](/library/ios/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP-CH3-SW51)
###2. [64-Bit transition Guide for Cocoa Touch (苹果官方文档)](/library/iOS/documentation/General/Conceptual/CocoaTouch64BitGuide/Introduction/Introduction.html)
###3. [Xcode设置项之Architectures和Valid Architectures](http://wangzz.github.io/blog//xcodeshe-zhi-xiang-zhi-architectureshe-valid-architectures/)
人打赏支持
码字总数 33594
支付宝支付
微信扫码支付
打赏金额: ¥
已支付成功
打赏金额: ¥}

我要回帖

更多关于 xcode8 run build卡住 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信