Xcode 8 Swift 3 应用程序是否可以在 iOS 7 上成功运行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38414469/
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
Do Xcode 8 Swift 3 apps run on iOS 7 successfully?
提问by user4806509
Do Xcode 8 Swift 3 apps run on iOS 7 successfully?
Xcode 8 Swift 3 应用程序是否可以在 iOS 7 上成功运行?
I've tried to determine this running a few tests described below, but can an expert with a better understanding of App Store development please help explain the reasons for the successes and failures including the questions below?
我已经尝试通过下面描述的一些测试来确定这一点,但是对 App Store 开发有更好理解的专家能否帮助解释成功和失败的原因,包括以下问题?
Test 1.
测试 1。
So I've opened up Xcode 7.3.1 and created an app with Swift 2.2. I'm intending to deploy the app from iOS 7 through to iOS 10.
所以我打开了 Xcode 7.3.1 并使用 Swift 2.2 创建了一个应用程序。我打算将应用程序从 iOS 7 部署到 iOS 10。
I run the app on the iOS 9.3 iPhone simulator with success and then run the app on an actual iOS 7.1.2 iPhone device with success also.
我在 iOS 9.3 iPhone 模拟器上成功运行了该应用程序,然后在实际的 iOS 7.1.2 iPhone 设备上也成功运行了该应用程序。
Test 2.
测试 2。
Next, I've taken the same project and opened it in Xcode 8 Beta 2. (I was prompted to update to either Swift 2.3 or Swift 3. I update to Swift 2.3 then later to Swift 3.)
接下来,我采用了相同的项目并在 Xcode 8 Beta 2 中打开它。(我被提示更新到 Swift 2.3 或 Swift 3。我更新到 Swift 2.3,然后更新到 Swift 3。)
After entering the iOS Target Deployment as 7.0 manually, I run the the app on the iOS 10 Beta 2 iPhone simulator with success. However, I then try to run the app on an actual iOS 7.1.2 iPhone device but no success this time, the below error is displayed. I repeat the test with Swift 2.3 and Swift 3 with the same error:
手动输入 iOS 目标部署为 7.0 后,我在 iOS 10 Beta 2 iPhone 模拟器上成功运行了该应用程序。但是,我然后尝试在实际的 iOS 7.1.2 iPhone 设备上运行该应用程序,但这次没有成功,显示以下错误。我用 Swift 2.3 和 Swift 3 重复测试,但出现相同的错误:
Could not locate device support files
This iPhone 4S is running iOS 7.1.2 (11D257), which may notbe supported by this version of Xcode.
找不到设备支持文件
这款 iPhone 4S 运行的是 iOS 7.1.2 (11D257),此版本的 Xcode可能不支持。
Test 3.
测试 3。
So next I try installing the .ipa app file created in Xcode 8 Beta 2 directly to the actual iOS 7.1.2 iPhone device via iTunes after getting an archive of the app (Product > Archive …)
因此,接下来我尝试在获取应用程序存档(产品 > 存档...)后,通过 iTunes 将在 Xcode 8 Beta 2 中创建的 .ipa 应用程序文件直接安装到实际的 iOS 7.1.2 iPhone 设备
After the .ipa app file is completed transferring to the iOS 7.1.2 iPhone device via iTunes, I then launch the app on the actual device, this time with success.
.ipa 应用程序文件通过 iTunes 完成传输到 iOS 7.1.2 iPhone 设备后,我然后在实际设备上启动该应用程序,这次成功。
Questions:
问题:
What can I make of all the testing outcomes in the table above?
Importantly, when it comes time to distributing the app through the App Store created in Xcode 8 with Swift 3, is it safe to expect that the app, which installed successfully via iTunes on an iOS 7.1.2 iPhone device, will still be compatible for all iOS 7 devices when downloaded at the App Store?
Xcode 7.3.1 allows devices from iOS 7 through to iOS 9 for testing and debugging while in development?
Xcode 8 does not allow iOS 7 devices for testing and debugging while in development but still allows deployment of apps to iOS 7 devices?
What is the point of Swift 2.3 as an intermediate step to Swift 3?
我可以如何理解上表中的所有测试结果?
重要的是,当需要通过使用 Swift 3 在 Xcode 8 中创建的 App Store 分发应用程序时,是否可以安全地期望通过 iTunes 在 iOS 7.1.2 iPhone 设备上成功安装的应用程序仍然兼容在 App Store 下载时所有 iOS 7 设备?
Xcode 7.3.1 允许从 iOS 7 到 iOS 9 的设备在开发过程中进行测试和调试吗?
Xcode 8 不允许 iOS 7 设备在开发过程中进行测试和调试,但仍允许将应用程序部署到 iOS 7 设备?
Swift 2.3 作为 Swift 3 的中间步骤有什么意义?
回答by Rob
I would hesitate to draw too many conclusions from your empirical tests. Specifically, I would notassume just because you got it to run on iOS 7 that it is guaranteed to work on iOS 7. They appear to only be guaranteeing iOS 8+ support.
我会犹豫从您的经验测试中得出太多结论。具体来说,我不会仅仅因为你让它在 iOS 7 上运行就假设它可以保证在 iOS 7 上运行。他们似乎只保证 iOS 8+ 支持。
As an aside, Apple generally suggests supporting only one iOS version back, anyway. And, as of May 9th, only 5% of devices are running iOS 7 or earlier (and this is likely to be further reduced by the time iOS 10 is released).
顺便说一句,无论如何,Apple 通常建议只支持一个 iOS 版本。并且,截至 5 月 9 日,只有 5% 的设备运行 iOS 7 或更早版本(并且在 iOS 10 发布时可能会进一步减少)。
回答by tktsubota
Do Xcode 8 Swift 3 apps run on iOS 7 successfully?
Xcode 8 Swift 3 应用程序是否可以在 iOS 7 上成功运行?
See Swift 3 iOS compatibility. Guaranteed iOS 8 support, unsure about iOS 7. See this answeron Swift 2 and iOS 7. The last comment states that Apple probably doesn't want you targeting iOS 7 anyways. If it doesn't work, it's probably not Swift that's the issue, but Xcode that is saying no.
请参阅Swift 3 iOS 兼容性。保证 iOS 8 支持,不确定 iOS 7。在 Swift 2 和 iOS 7 上看到这个答案。最后一条评论指出 Apple 可能不希望你以 iOS 7 为目标。如果它不起作用,那么问题可能不是 Swift,而是 Xcode 说不。
What can I make of all the testing outcomes in the table above?
我可以如何理解上表中的所有测试结果?
I'm not sure what you mean here.
我不确定你在这里的意思。
Importantly, when it comes time to distributing the app through the App Store created in Xcode 8 with Swift 3, is it safe to expect that the app, which installed successfully via iTunes on an iOS 7.1.2 iPhone device, will still be compatible for all iOS 7 devices when downloaded at the App Store?
重要的是,当需要通过使用 Swift 3 在 Xcode 8 中创建的 App Store 分发应用程序时,是否可以安全地期望通过 iTunes 在 iOS 7.1.2 iPhone 设备上成功安装的应用程序仍然兼容在 App Store 下载时所有 iOS 7 设备?
It's probably never safe to expect anything in which you are trying to work around Xcode.
期望您尝试在 Xcode 周围工作的任何事情可能永远不会安全。
Xcode 7.3.1 allows devices from iOS 7 through to iOS 9 for testing and debugging while in development?
Xcode 7.3.1 允许从 iOS 7 到 iOS 9 的设备在开发过程中进行测试和调试吗?
And? Xcode 8 doesn't. iOS 7 through iOS 9 is two versions, iOS 8 through iOS 10 is two versions.
和?Xcode 8 没有。iOS 7 到 iOS 9 是两个版本,iOS 8 到 iOS 10 是两个版本。
What is the point of Swift 2.3 as an intermediate step to Swift 3?
Swift 2.3 作为 Swift 3 的中间步骤有什么意义?
Because Swift 3 is such a major jump from Swift 2.2, they provide Swift 2.3 if you aren't ready to go to Swift 3 yet. However, they recommend going to Swift 3. Swift 3 also allows you to access some new features.
由于 Swift 3 是 Swift 2.2 的重大飞跃,如果您还没有准备好使用 Swift 3,它们会提供 Swift 2.3。但是,他们建议使用 Swift 3。Swift 3 还允许您访问一些新功能。