本文介绍了在Objective-C中,如何以编程方式获取设备的BuildID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

On an Apple device go to Setting -> General -> About

在关于"页面中查看设备的版本".

Look at "Version" of device in About page.

应显示类似"Version 9.0(13A344)"的字样

It should say something like "Version 9.0 (13A344)"

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

I know how to get the 9.0 programmatically in objective-C.

如何获取BuildID(即13A344)?

How can I get BuildID (i.e. 13A344) ?

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

我可能是错的.

推荐答案

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

You could poll the SystemVersion.plist like so:

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";

这篇关于在Objective-C中,如何以编程方式获取设备的BuildID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 09:11