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

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

问题描述

在这里我们可以看到苹果宣布。根据这个文档,我们可以提交相同的二进制支持32位和64也位。我发现一个堆栈溢出的答案<一个href=\"http://stackoverflow.com/questions/18913906/x$c$c-5-and-ios-7-architecture-and-valid-architectures\">here.但根据这个答案,我们设置部署目标为IO7 + 。但苹果医生说,你可以与IOS 7和iOS 6的支持,提交此?我的问题是,如何才能生成二进制支持32位和部署目标64位iOS6的+?

注意:我用 X code 5.0

更新: 问题上面用X code 5.0.2固定。但我感到困惑,我怎样才能使32位code以及64位。我知道一件事,我们必须在某些时候做code两分开。但我该怎么办?。例如,如果在去$ P $一种方法在iOS6的手段pcated,我们提供code适用于iOS 6和ios7也。在相同的情况下,也跟着在这里还是为这个做一些其他的工艺。


解决方案

  

X code可与包括32位和64位二进制文​​件构建应用程序
  因此它可以跨越运行iOS 7.如果您希望继续所有设备
  支持iOS 6的话,您将需要建立仅32位。下一个
  本月,我们将作出修改,将允许您创建一个单一的
  支持在iOS 6中的32位,以及32位和64位应用程序二进制
  在iOS 7。


  
  

转换您的应用程序到64位二进制


  
  

在一个较高的水平,这里有创建的目标都一个应用程序的步骤
  的32位和64位的运行时环境:


  
  

1.安装X $ C $Ç5.0.1。


  
  

2.Open项目。 X $ C $ç提示您到您的项目现代化。现代化项目增加了新的警告和错误的
  编译您的应用程序为64位时非常重要的。


  
  

3.Update您的项目设置,支持的iOS 5.1.1或更高版本。如果它的目标是在iOS版本低于你不能建立一个64位的项目
  的iOS 5.1。


  
  

4.Change的架构建立项目设置为标准架构(包括64位)。


  
  

5.Update您的应用程序,支持64位运行时环境。新的编译器警告和错误将有助于引导您完成此过程。
  但是,编译器不会为你做所有的工作;使用
  本文档中的信息,以帮助您完成调查
  你自己的code。


  
  

6.测试实际的64位硬件的应用程序。 iPhone模拟器也可以在开发过程中有帮助的,但有些更改,诸如功能
  调用约定,只有当您的应用程序上运行的可见
  设备。


  
  

7.使用工具来调整你的应用程序的内存性能。


  
  

8.Submit一个应用程序,包括架构进行审批。


  
  

本章的其余部分介绍经常发生的问题
  移植一个可可触摸应用程序时,64位运行时环境。使用
  这些章节来指导自己的努力来调查你的code。


从<一个href=\"https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1\" rel=\"nofollow\">https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1

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+?

Note: I'm using xcode 5.0

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 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.

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

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

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