简体   繁体   English

iPhone:最低操作系统,部署目标和基础/活动SDK

[英]iPhone: Minimum OS, Deployment Target & Base/Active SDK

I'm a little confused about building an app for the app store and for the correct SDK & OS version. 我对为应用程序商店构建应用程序以及正确的SDK和OS版本感到困惑。 I have submitted my app to the app store, and in the app details screen of iTunes connection it says: 我已将我的应用程序提交到应用程序商店,并在iTunes连接的应用程序详细信息屏幕中显示:

"Minimum OS Requirements : 3.1.2" “最低操作系统要求:3.1.2”

I haven't seen any apps on the app store that have 3.1.2 as the min OS, they all say 3.0. 我没有在应用程序商店看到任何有3.1.2作为最低操作系统的应用程序,他们都说3.0。 I read several things on here before I built it and I thought I understood everything! 在我构建它之前,我在这里阅读了几个东西,我以为我理解了一切!

Basically, my app doesn't use any code that only exists in > 3.0 so I would like the minimum OS to be 3.0. 基本上,我的应用程序不使用仅存在于> 3.0的任何代码,所以我希望最低操作系统为3.0。 My build settings were: 我的构建设置是:

Target Info 目标信息

  • Base SDK: iPhone Device 3.0 基础SDK:iPhone设备3.0
  • iPhone OS Deployment Target: iPhone OS 3.0 iPhone OS部署目标:iPhone OS 3.0

Xcode Main Window Xcode主窗口

  • Active SDK: iPhone Device 3.1.2 活动SDK:iPhone设备3.1.2

I've heard about a minimum OS version being put in the Info.plist but I haven't got anything like that in mine. 我听说Info.plist中有一个最低操作系统版本,但是我没有这样的东西。

I build the app exactly like that and submitted it. 我完全像这样构建应用程序并提交它。 Are my app settings correct? 我的应用设置是否正确? Will my app display 3.0 in the app store or 3.1.2? 我的应用会在应用商店或3.1.2中显示3.0吗? I'm a little unsure as to why you set the Active SDK to the latest (3.1.2) when you want to target 3.0 , 3.1 & 3.12 devices, but it's what I read! 当你想要定位3.0,3.1和3.12设备时,我有点不确定为什么你将Active SDK设置为最新版本(3.1.2),但这就是我读到的内容!

Any help advice be greatly appreciated! 非常感谢任何帮助建议!

Okay I've managed to figure it out after much reading! 好吧,经过多次阅读,我已经成功解决了这个问题!

Basically, the Active SDK is just a build time override of the Base SDK. 基本上,Active SDK只是Base SDK的构建时覆盖。 By default, when the Base SDK changes it automatically changes the Deployment Target to the same OS as the SDK. 默认情况下,当Base SDK更改时,它会自动将部署目标更改为与SDK相同的操作系统。 So when I wanted to build the app under the 3.1.2 SDK but have it run on 3.0 OS, I changed the Active SDK to 3.1.2, but that had automatically changed the minimum OS (deployment target). 因此,当我想在3.1.2 SDK下构建应用程序但在3.0 OS上运行时,我将Active SDK更改为3.1.2,但这已自动更改了最低操作系统(部署目标)。 I saw this by looking at the Info.plist file in the package contents in my .app file. 我通过查看.app文件中包内容中的Info.plist文件看到了这一点。

So the best thing to do is to set the Base SDK to the latest SDK (currently 3.1.2) and then manually set the Deployment Target to 3.0 OS. 因此,最好的办法是将Base SDK设置为最新的SDK(当前为3.1.2),然后手动将Deployment Target设置为3.0 OS。 Once the 2 are different then it will no longer automatically change. 一旦2不同,它将不再自动改变。

However, this means that your app can install on a 3.0 device that may have 3.0, 3.1, or 3.1.2 SDKs. 但是,这意味着您的应用程序可以安装在可能具有3.0,3.1或3.1.2 SDK的3.0设备上。 Therefore, any frameworks, methods or properties you use that are only available in SDKs greater than 3.0 you will have to use conditionally . 因此,您使用的任何框架,方法或属性仅在大于3.0的SDK中可用,您必须有条件地使用。

When you get around to building the app, ensure that that Active Target is set as the same as your Base SDK, eg Device 3.1.2. 当您开始构建应用程序时,请确保将Active Target设置为与基本SDK相同,例如Device 3.1.2。 But remember to compile your app under Device 3.0, Device 3.1, and Device 3.1.2 just to check for compiler warnings. 但请记住在Device 3.0,Device 3.1和Device 3.1.2下编译您的应用程序只是为了检查编译器警告。 This will ensure that you don't have any code accessing methods/frameworks that don't exist in any SDKs down to your Deployment Target. 这将确保您没有任何代码访问任何SDK中不存在的部署目标的方法/框架。

I hope this helps anyone who is in my position and couldn't find a simple explanation of how it all works. 我希望这可以帮助任何处于我的位置并且无法找到一切有效的简单解释的人。

The SDK Compatibility Guide was very useful and informative. SDK兼容性指南非常有用且信息丰富。 However it took just a little extra figuring out for me to be comfortable with the concept and how everything works. 然而,为了让我对这个概念以及一切如何运作感到满意,我只花了一点时间。 This image from the guide is useful: 该指南中的图像非常有用:

替代文字
(source: apple.com ) (来源: apple.com

转到项目信息 - >构建并查看IPHONEOS_DEPLOYMENT_TARGET属性实际上我使用3.1.2 SDK并构建一个适用于每个高于2.2.1的操作系统的应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM