gpt4 book ai didi

ios - 在 Objective-C 中,如何以编程方式获取设备的 BuildID

转载 作者:行者123 更新时间:2023-11-29 00:53:16 26 4
gpt4 key购买 nike

在 Apple 设备上转到设置 -> 常规 -> 关于

在关于页面中查看设备的“版本”。

它应该说类似“版本 9.0 (13A344)”

我知道如何在 Objective-C 中以编程方式获取 9.0。

如何获取 BuildID(即 13A344)?

根据我在 http://www.ipsw.me/9.0 上看到的内容,我认为 BuildID 是正确的使用术语

虽然我可能是错的。

最佳答案

您可以像这样轮询 SystemVersion.plist:

NSDictionary *systemVersion = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
if (systemVersion != nil) {

NSString *sysInfo = [NSString stringWithFormat:@"%@ %@ (Build %@)",
[systemVersion objectForKey:@"ProductName"],
[systemVersion objectForKey:@"ProductVersion"],
[systemVersion objectForKey:@"ProductBuildVersion"]];
}

这将为您带来:

ProductBuildVersion = 13E238;
ProductCopyright = "1983-2016 Apple Inc.";
ProductName = "iPhone OS";
ProductVersion = "9.3.1";

关于ios - 在 Objective-C 中,如何以编程方式获取设备的 BuildID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37884444/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com