ios - 单个应用程序二进制文件如何支持 64 位和 32 位应用程序

标签 ios iphone app-store 32bit-64bit

可以看到苹果公告here. .根据此文档,我们可以提交支持 32 位和 64 位的相同二进制文件。我找到了一个堆栈溢出答案 here .但是根据这个答案,我们应该设置deployment target as IO7+。但是apple doc说,你可以在IOS 7和IOS 6支持的情况下提交这个吗?我的问题是,我们如何通过部署目标 IOS6+ 生成支持 32 位和 64 位的二进制文件?

注意:我使用的是xcode 5.0

更新: 上述问题已使用 xcode 5.0.2 修复。但是我很困惑如何为 32 位和 64 位编写代码。我知道一件事,我们必须在某些时候分别为两个人编写代码。但是 我该怎么做?。例如,如果 ios6 中弃用的一种方法意味着,我们还提供适用于 ios 6 和 ios7 的代码。在同样的情况下也遵循这里或为此做一些其他技术。

最佳答案

Xcode can build your app with both 32-bit and 64-bit binaries included so it works across all devices running iOS 7. If you wish to continue to support iOS 6 then you will need to build for 32-bit only. Next month we will be making changes that will allow you create a single app binary that supports 32-bit on iOS 6, as well as 32-bit and 64-bit on iOS 7.

Converting Your App to a 64-Bit Binary

At a high level, here are the steps to create an app that targets both the 32-bit and the 64-bit runtime environments:

1.Install Xcode 5.0.1.

2.Open your project. Xcode prompts you to modernize your project. Modernizing the project adds new warnings and errors that are important when compiling your app for 64-bit.

3.Update your project settings to support iOS 5.1.1 or later. You can’t build a 64-bit project if it targets an iOS version earlier than iOS 5.1.

4.Change the Architectures build setting in your project to “Standard Architectures (including 64-bit).”

5.Update your app to support the 64-bit runtime environment. The new compiler warnings and errors will help guide you through this process. However, the compiler doesn’t do all of the work for you; use the information in this document to help guide you through investigating your own code.

6.Test your app on actual 64-bit hardware. iOS Simulator can also be helpful during development, but some changes, such as the function calling conventions, are visible only when your app is running on a device.

7.Use Instruments to tune your app’s memory performance.

8.Submit an app that includes both architectures for approval.

The remainder of this chapter describes problems that frequently occur when porting a Cocoa Touch app to the 64-bit runtime environment. Use these sections to guide your own efforts to investigate your code.

来自 https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1

关于ios - 单个应用程序二进制文件如何支持 64 位和 32 位应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21200669/

相关文章:

ios - 如果我的应用程序重定向到设置页面,Apple 应用程序会拒绝我的应用程序吗?

iphone - 应用程序因使用 libsqlite3.dylib 而被拒绝

ios - 使用大量数据打包IOS App

ios - 如何快速将图像数组转换为任何对象

ios - Xcodebuild 的 .app 立即崩溃?但是Xcode的.app运行成功

ios - 如何将数组写入plist?

iphone - iPhone 中具有水平和垂直滚动功能的表格 View

iphone - 断开互联网连接时如何处理 NSJSONSerialization 的崩溃

iphone - 卡住了 "Command/usr/bin/codesign failed with exit code 1 "错误

ios - 某些电子邮件应用程序禁止向其他人发送带有自定义 OpenURL 方案的链接