Single App Binary 如何支持 64 位和 32 位应用程序 [英] How Single App Binary Supports 64-bit and 32-bit Apps

查看:45
本文介绍了Single App Binary 如何支持 64 位和 32 位应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

We can see apple announcement here.. According to this doc, we can submit same binary with supporting 32-bit and also 64-bit. I found one stack overflow answer here. But According to this answer, we should set deployment target as IO7+. But apple doc said, you can submit this with IOS 7 and IOS 6 support? My question is, How can we generate binary with supporting 32-bit and 64-bit by deployment target IOS6+?

注意:我使用的是 xcode 5.0

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

Update: Question above is fixed by using xcode 5.0.2. But I get confused how can I make code for 32-bit as well 64-bit. I know one thing, we must do code for two separately in some times. But How can I do?. for example, if one method in deprecated in ios6 means, we provide code for ios 6 and ios7 also. In same case also followed here or do some other technic for this.

推荐答案

Xcode 可以构建包含 32 位和 64 位二进制文​​件的应用程序所以它适用于所有运行 iOS 7 的设备.如果你想继续要支持 iOS 6,那么您只需要为 32 位构建.下一个一个月我们将进行更改,使您可以创建单个在 iOS 6 上支持 32 位以及 32 位和 64 位的应用程序二进制文件在 iOS 7 上.

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.

将您的应用程序转换为 64 位二进制文​​件

概括地说,以下是创建同时针对这两个目标的应用的步骤32 位和 64 位运行时环境:

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.安装 Xcode 5.0.1.

1.Install Xcode 5.0.1.

2.打开你的项目.Xcode 会提示您对项目进行现代化改造.项目现代化增加了新的警告和错误为 64 位编译应用时很重要.

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.更新您的项目设置以支持 iOS 5.1.1 或更高版本.如果 64 位项目面向的 iOS 版本早于iOS 5.1.

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. 将项目中的架构构建设置更改为标准架构(包括 64 位)".

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

5.更新您的应用以支持 64 位运行时环境.新的编译器警告和错误将帮助指导您完成此过程.但是,编译器不会为您完成所有工作.使用本文档中的信息可帮助指导您完成调查您自己的代码.

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.在实际的 64 位硬件上测试您的应用.iOS Simulator 也可以在开发过程中有所帮助,但有一些变化,例如功能调用约定,仅当您的应用程序运行在设备.

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.使用 Instruments 调整应用的内存性能.

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

8. 提交包含两种架构的应用以供批准.

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

本章的其余部分描述了经常出现的问题将 Cocoa Touch 应用程序移植到 64 位运行时环境时.用这些部分用于指导您自己调查代码的工作.

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

这篇关于Single App Binary 如何支持 64 位和 32 位应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆