简体   繁体   English

在 Xcode 中设置最低 iOS 版本

[英]Setting the Minimum iOS version in Xcode

I'm fairly new to Xcode as I use CocoonJS to build my HTML5 iPhone game but I want to know how to correctly set the minimum iOS version.我对 Xcode 相当陌生,因为我使用 CocoonJS 构建我的 HTML5 iPhone 游戏,但我想知道如何正确设置最低 iOS 版本。 I've set my deployment target to 8.0 and did a clean and then a build but when I submit to the app store it says the minimum iOS version is 6.0.我已将我的部署目标设置为 8.0 并进行了清理,然后进行了构建,但是当我提交到应用商店时,它说最低 iOS 版本是 6.0。

The next thing I tried was manually updating this value in the info.plist but then I get an invalid binary in iTunes Connect saying我尝试的下一件事是手动更新 info.plist 中的这个值,但后来我在 iTunes Connect 中得到一个无效的二进制文件说

Minimum OS Version Mismatch - The minimum OS version (LC_VERSION_MIN_IPHONEOS) in the binary ('6.0') for architecture ('armv7') differs from the MinimumOSVersion ('8.0') in the Info.plist最低操作系统版本不匹配 - 体系结构 ('armv7') 的二进制 ('6.0') 中的最低操作系统版本 (LC_VERSION_MIN_IPHONEOS) 与 Info.plist 中的最低操作系统版本 ('8.0') 不同

How do I update the minimum iOS version correctly without screwing up my binary?如何在不搞砸二进制文件的情况下正确更新最低 iOS 版本? I've checked other threads but they all just say to update just the deployment target.我检查了其他线程,但他们都只是说只更新部署目标。

Assuming you're building against the 8.x SDK, and you have set the deployment target to 8.x or higher, that'll be enough.假设您是针对 8.x SDK 构建的,并且您已将部署目标设置为 8.x 或更高版本,这就足够了。

However, I'd imagine you set the deployment target the wrong place in Xcode.但是,我想您将部署目标设置在 Xcode 中的错误位置。 You'll need to set it under your Project and not under your Target .您需要将其设置在您的Project下,而不是您的Target下。 Alternatively, if you have a .xcconfig file, you can change it by setting或者,如果你有一个.xcconfig文件,你可以通过设置来改变它

IPHONEOS_DEPLOYMENT_TARGET = 8.1

If you don't have a .xcconfig , you can verify the deployment target, by opening your project.pbxproj file, and search for IPHONEOS_DEPLOYMENT_TARGET , and check if it's set to your expected value.如果您没有.xcconfig ,您可以通过打开project.pbxproj文件并搜索IPHONEOS_DEPLOYMENT_TARGET来验证部署目标,并检查它是否设置为您的预期值。

If you have Xcode .xcworkspace setup, say coming from ReactNative background, you would need to make sure:如果你有 Xcode .xcworkspace设置,比如来自 ReactNative 背景,你需要确保:

  • iOS Deployment Target set to 14.1 or whatever version you want to be minimum inside the Project > Build Settings > Deployment for all instances. iOS 部署目标设置为14.1或您希望在所有实例的项目> 构建设置 > 部署中最低的任何版本。
  • iOS Deployment Target set to 14.1 or whatever version you want to be minimum inside the Target > Build Settings > Deployment for all instances. iOS 部署目标设置为14.1或您希望在Target > Build Settings > Deployment 中为所有实例设置的最低版本。
  • The deployment info in Target > General > Deployment Info is set to the minimum support version before the iPhone checkmark. Target > General > Deployment Info 中的部署信息设置为 iPhone 勾选前的最低支持版本。

iOS 最低部署信息

To Verify the minimum version is set properly.验证最低版本设置是否正确。

  • Archive the project.归档项目。
  • Validate and Distribute the Development version of the app.验证和分发应用程序的开发版本。
  • Locate the folder where the ipa was exported找到导出 ipa 的文件夹
  • Open the .ipa with some archive utility software (example The unarchiver)使用一些归档实用软件打开 .ipa(例如 The unarchiver)
  • Drag or Open the Info.plist in any code editor在任何代码编辑器中拖动或打开Info.plist
  • Search for MinimumOSVersion and check whether the minimum os version reflects the required version.搜索MinimumOSVersion并检查最低操作系统版本是否反映所需版本。

Info.plist 中的最低操作系统版本

Even after updating the Deployment Targets the archive doesn't update with the set version, force exit xcode and re-open the workspace/project.即使更新了部署目标,存档也不会更新为设置的版本,强制退出 xcode 并重新打开工作区/项目。 Check if the settings from previous session were applied, look for every instance where 14.x or whatever the current minimum version is present and update to the one required.检查是否应用了上一个会话的设置,查找存在14.x或任何当前最低版本的每个实例,并更新到所需的版本。 Probably quit the Xcode once again and re-open.可能会再次退出 Xcode 并重新打开。 Generate the archive again and it should be reflect this time.再次生成存档,这一次应该反映。

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

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