ios 部署目标是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41278392/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does deployment target mean?
提问by Michaelcode
this is a very simple question I'm assuming. Can someone tell me what deployment target means. If I choose IOS 10, does that mean only users with iOS 10 can download the app. Is it bad to choose a lower deployment target? ALSO, continuing on deployment target, is it not recommended to run on a lower deployment target.
这是我假设的一个非常简单的问题。有人可以告诉我部署目标是什么意思。如果我选择 IOS 10,是否意味着只有 iOS 10 的用户才能下载该应用程序。选择较低的部署目标是不是很糟糕?另外,继续部署目标,不建议在较低的部署目标上运行。
回答by Manish Pathak
Lets say you have set minimum deployment target to iOS 9. This means your application is compatible for iOS 9 and abovedevices.
假设您已将最低部署目标设置为 iOS 9。这意味着您的应用程序兼容 iOS 9 及更高版本的设备。
The application won't run on below9.0 devices but can run on any iOS version greaterthan iOS 9.0.
该应用程序将无法运行在低于9.0的设备,但可以在任何的iOS版本上运行更多的比的iOS 9.0。
回答by Naveed Abbas
The deployment target determines your app's ability to run on older iOS versions.
部署目标决定了您的应用程序在较旧的 iOS 版本上运行的能力。
App with deployment target set to 10 will work on iOS version 10+ (10, 11, 12, 13 ...) but won't work on 9.x.
App with deployment target set to 10 will work on iOS version 10+ (10, 11, 12, 13 ...) but won't work on 9.x.
When a new version of iOS is released, some people do not bother to update their devices to the latest iOS version and thus they can't download your app from the App Store
.
当新版本的 iOS 发布时,有些人懒得将他们的设备更新到最新的 iOS 版本,因此他们can't download your app from the App Store
.
Example
例子
If you choose higher deployment target (e.g 12.1)
, your app won't be able to download for the people who even have latest devices but have older iOS version (iPhone X with 11.0). In ContrastIf you choose lowest possible deployment target (e.g 6.0)
, you try to make your app maximum backward compatible (so even if someone hasn't updated their iOS in ages will be able to download your app).
如果您选择更高的部署目标(e.g 12.1)
,您的应用程序将无法为即使拥有最新设备但具有较旧 iOS 版本(iPhone X 11.0)的人下载。相比之下,如果您选择尽可能低的部署目标(e.g 6.0)
,您会尝试使您的应用程序最大程度地向后兼容(这样即使有人多年没有更新他们的 iOS 也能够下载您的应用程序)。
CAUTION
警告
Many (almost all) newer frameworks and features won't be able to run properly (Behave as expected) on lower iOS versions which increases the chances of app crashes.
许多(几乎所有)较新的框架和功能将无法在较低的 iOS 版本上正常运行(按预期运行),这增加了应用程序崩溃的可能性。
What Affects Deployment Target
什么影响部署目标
Following are few factors that demands higher deployment target.
以下是要求更高部署目标的几个因素。
1) Using latest iOS SDK (alone)
1)使用最新的iOS SDK(单独)
2) Using latest iOS SDK specific features (Constraints, newer XIB files etc).
2) 使用最新的 iOS SDK 特定功能(约束、更新的 XIB 文件等)。
3) Using fast adapting external libraries / Frameworks (e.g Facebook SDK, Firebase etc).
3) 使用快速适应的外部库/框架(例如 Facebook SDK、Firebase 等)。
4) Higher Swift Version (5.0) requires higher deployment target vs writing your app in legacy Objective C) !Needs citation
.
4) 更高的 Swift 版本 (5.0) 需要更高的部署目标,而不是在传统的 Objective C) 中编写您的应用程序!Needs citation
。
SOLUTION
解决方案
We have been using Deploymatefor maximum backward support. It mainly assists us about warning the following:
我们一直在使用Deploymate以获得最大的向后支持。它主要帮助我们进行以下警告:
1) Newer APIs that won't work on lower iOS versions
1) 较新的 API 不适用于较低的 iOS 版本
2) Using deprecated methods that won't work on newer iOS versions.
2) 使用已弃用的方法,这些方法不适用于较新的 iOS 版本。
This is when you start fixing your code to make it available for lower iOS versions for maximum compatibility.
这是您开始修复代码以使其可用于较低的 iOS 版本以获得最大兼容性的时候。
Note:Xcode also informs about several pitfalls. Deploymate is neither associates with us or pay us in any form. You can look for other alternates.
注意:Xcode 还告知了几个陷阱。Deploymate 既不与我们有任何关联,也不以任何形式向我们付款。您可以寻找其他替代品。
回答by benc
If you are new to Xcode, I suggest accepting the default, and thinking of it as a constraint on your project.
如果您不熟悉 Xcode,我建议您接受默认设置,并将其视为对您项目的约束。
As newer of Xcode versions come along, support for older target values will be removed. Companies that have extensive customer bases have to deal with this problem in their own way.
随着新的 Xcode 版本的出现,对旧目标值的支持将被删除。拥有广泛客户群的公司必须以自己的方式处理这个问题。
In most projects I have worked on, the iOS version matters because it dictates which devices can run your application.
在我参与的大多数项目中,iOS 版本很重要,因为它决定了哪些设备可以运行您的应用程序。
For example, iOS 10 essentially left behind all iPod-style connectors.
例如,iOS 10 基本上留下了所有 iPod 风格的连接器。