[英]Xcode 5 and iOS 7: Architecture and Valid architectures
I'm starting new project in Xcode 5. I want to develop application using iOS SDK 7
but with deployment target iOS 5.0
. 我正在Xcode 5中开始新项目。我想使用
iOS SDK 7
开发应用程序,但部署目标是iOS 5.0
。 As soon as I create new project in Xcode and try to change deployment target to 5.0, I've got this message: 一旦我在Xcode中创建新项目并尝试将部署目标更改为5.0,我就收到此消息:
Applications including an arm64 slice are not compatible with versions of iOS
prior to 6.0
Adjust your Architectures build setting to not include arm64 in order to deploy
to releases prior to iOS 6.0.
So changed architectures to Standard
(no 64bit). 因此将架构更改为
Standard
(无64位)。 I compiles, runs but I do not really understand what just happend. 我编译,运行,但我真的不明白刚刚发生了什么。
What's the difference between Architectures
and Valid architectures
settings in Xcode project Build Settings? Xcode项目构建设置中的
Valid architectures
Architectures
和Valid architectures
设置之间有什么区别?
If I set Architectures
to exclude 64-bit what happens when I run my app on 64-bit iPhone or iOS Simulator (I know it works, I'm just curious what hapens underneath)? 如果我将
Architectures
设置为排除64位当我在64位iPhone或iOS模拟器上运行我的应用程序时会发生什么(我知道它有效,我只是好奇下面有什么问题)?
Can you explain big mess with new 64-bit architecture? 你能用新的64位架构来解释大混乱吗?
Set the architecture in build setting to Standard architectures(armv7,armv7s) 将构建设置中的体系结构设置为标准体系结构(armv7,armv7s)
iPhone 5S is powered by A7 64bit processor. iPhone 5S采用A7 64位处理器。 From apple docs
来自苹果文档
Xcode can build your app with both 32-bit and 64-bit binaries included.
Xcode可以构建包含32位和64位二进制文件的应用程序。 This combined binary requires a minimum deployment target of iOS 7 or later.
这种组合二进制文件需要iOS 7或更高版本的最低部署目标。
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.
注意:Xcode的未来版本将允许您创建一个支持iOS 6及更高版本上的32位运行时的应用程序,并支持iOS 7上的64位运行时。
From the documentation what i understood is 从文档中我理解的是
Update (Xcode 5.0.1) 更新(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中,他们添加了对iOS 5.1.1以后创建64位二进制文件的支持。
Xcode 5.0.1 can build your app with both 32-bit and 64-bit binaries included.
Xcode 5.0.1可以构建包含32位和64位二进制文件的应用程序。 This combined binary requires a minimum deployment target of iOS 5.1.1 or later.
此组合二进制文件需要iOS 5.1.1或更高版本的最低部署目标。 The 64-bit binary runs only on 64-bit devices running iOS 7.0.3 and later.
64位二进制文件仅在运行iOS 7.0.3及更高版本的64位设备上运行。
Update (Xcode 5.1) 更新(Xcode 5.1)
Xcode 5.1 made significant change in the architecture section. Xcode 5.1在架构部分做了重大改变。 This answer will be a followup for you.
这个答案将是您的后续跟进。 Check this
检查一下
When you set 64-bit the resulting binary is a "Fat" binary, which contains all three Mach-O images bundled with a thin fat header. 当你设置64位时,生成的二进制文件是一个“Fat”二进制文件,它包含所有三个与瘦胖文件头捆绑在一起的Mach-O图像。 You can see that using otool or jtool.
你可以看到使用otool或jtool。 You can check out some fat binaries included as part of the iOS 7.0 SDK, for example the AVFoundation Framework, like so:
您可以查看一些包含在iOS 7.0 SDK中的胖二进制文件,例如AVFoundation Framework,如下所示:
% cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/7.0\ \(11A465\)/Symbols/System/Library/Frameworks/AVFoundation.framework/
%otool -V -f AVFoundation 9:36
Fat headers
fat_magic FAT_MAGIC
nfat_arch 3
architecture arm64 # The 64-bit version (A7)
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
capabilities 0x0
offset 16384
size 2329888
align 2^14 (16384)
architecture armv7 # A5X - packaged after the arm64version
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7
capabilities 0x0
offset 2359296
size 2046336
align 2^14 (16384)
architecture armv7s # A6 - packaged after the armv7 version
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7S
capabilities 0x0
offset 4407296
size 2046176
align 2^14 (16384)
As for the binary itself, it uses the ARM64 bit instruction set, which is (mostly compatible with 32-bit, but) a totally different instruction set. 至于二进制本身,它使用ARM64位指令集,它(主要与32位兼容,但是)完全不同的指令集。 This is especially important for graphics program (using NEON instructions and registers).
这对于图形程序(使用NEON指令和寄存器)尤为重要。 Likewise, the CPU has more registers, which makes quite an impact on program speed.
同样,CPU有更多寄存器,这对程序速度有很大影响。 There's an interesting discussion in http://blogs.barrons.com/techtraderdaily/2013/09/19/apple-the-64-bit-question/?mod=yahoobarrons on whether or not this makes a difference;
在http://blogs.barrons.com/techtraderdaily/2013/09/19/apple-the-64-bit-question/?mod=yahoobarrons中有一个有趣的讨论是否会产生影响; benchmarking tests have so far clearly indicated that it does.
到目前为止,基准测试已明确表明它确实如此。
Using otool -tV will dump the assembly (if you have XCode 5 and later), and then you can see the instruction set differences for yourself. 使用otool -tV将转储程序集(如果你有XCode 5及更高版本),然后你可以看到自己的指令集差异。 Most (but not all) developers will remain agnostic to the changes, as for the most part they do not directly affect Obj-C (CG* APIs notwithstanding), and have to do more with low level pointer handling.
大多数(但不是全部)开发人员将对变化保持不可知,因为大多数情况下他们并不直接影响Obj-C(尽管CG * API),并且必须在低级指针处理方面做更多事情。 The compiler will work its magic and optimizations.
编译器将实现其魔术和优化。
My understanding from Apple Docs. 我对Apple Docs的理解。
What is Valid Architectures (VALID_ARCHS) into Xcode build-settings? 什么是有效架构 (VALID_ARCHS)到Xcode构建设置?
Example :- One iOS project has following build-settings into Xcode. 示例: - 一个iOS项目在Xcode中具有以下构建设置。
You do not need to limit your compiler to only armv7 and armv7s by removing arm64 setting from supported architectures. 通过从支持的体系结构中删除arm64设置,您无需将编译器限制为仅限armv7和armv7s 。 You just need to set Deployment target setting to 5.1.1
您只需将部署目标设置设置为5.1.1
Important note: you cannot set Deployment target to 5.1.1 in Build Settings section because it is drop-down only with fixed values. 重要说明:您无法在“ 构建设置”部分中将“部署目标”设置为5.1.1,因为它仅使用固定值下拉。 But you can easily set it to 5.1.1 in General section of application settings by just typing the value in text field.
但只需在文本字段中键入值,即可在应用程序设置的常规部分轻松将其设置为5.1.1。
Simple fix: 简单修复:
Targets -> Build Settings -> Build Options -> Enable Bitcode -> No 目标 - >构建设置 - >构建选项 - >启用Bitcode - >否
Works on device with iOS 9.3.3 适用于iOS 9.3.3的设备
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.