您的位置:首页 > 移动开发 > IOS开发

ios获取硬件信息

2014-12-01 18:55 204 查看
主要是为了给自己看的,有点记不住:
- (void)viewDidLoad {
[super viewDidLoad];

//联系人
NSString *strName = [[UIDevice currentDevice] name];
NSLog(@"设备名称:%@",
strName);//e.g. "My iPhone"

NSUUID *strId = [[UIDevice currentDevice] identifierForVendor];
NSLog(@"设备唯一标识:%@",
strId);//

NSString *strSysName = [[UIDevice currentDevice]systemName];
NSLog(@"版本名称%@",strSysName);

NSString *strSysVersion = [[UIDevice currentDevice]systemVersion];
NSLog(@"版本号%@",strSysVersion);

NSString *strModel1 = [[UIDevice currentDevice] model];
NSLog(@"设备模式:%@",strModel1);

NSString *strLocModel = [[UIDevice currentDevice] localizedModel];
NSLog(@"本地设备模式:%@",strLocModel);

//app应用相关信息的获取
NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];
NSLog(@"dicInfo :%@",dicInfo);

NSString *strAppName = [dicInfo objectForKey:@"CFBundleName"];
NSLog(@"app应用名称:%@",strAppName);

NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];
NSLog(@"应用版本信息:%@ - %@",strAppVersion,[dicInfo
objectForKey:(NSString *)kCFBundleVersionKey]);

NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];
NSLog(@"App应用BUild版本:%@",strAppBuild);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: