码迷,mamicode.com
首页 > 移动开发 > 详细

获取手机参数

时间:2016-03-21 10:41:51      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:

 1     // 应用名称
 2     NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
 3     NSString *appName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
 4     NSLog(@"应用名称:%@",appName);
 5     
 6     // 版本号
 7     NSString *shortVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
 8     NSLog(@"版本号:%@",shortVersion);
 9     
10     // 版本号(int类型)
11     NSString *version = [infoDictionary objectForKey:@"CFBundleVersion"];
12     NSLog(@"版本号(int类型):%@",version);
13     
14     // 手机标识符
15     NSUUID* identifierForVendor = [[UIDevice currentDevice] identifierForVendor];
16     NSLog(@"手机标识符: %@",identifierForVendor);
17     
18     // 手机
19     CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
20     NSString *uuid = (NSString *)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault,uuidRef));
21     NSLog(@"手机uuid: %@",uuid);
22     
23     // 系统
24     NSString *systemName = [[UIDevice currentDevice] systemName];
25     NSLog(@"系统: %@",systemName );
26     
27     // 手机系统版本
28     NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
29     NSLog(@"手机系统版本: %@", systemVersion);
30     
31     // 用户手机名
32     NSString* phoneName = [[UIDevice currentDevice] name];
33     NSLog(@"用户手机名: %@", phoneName);
34     
35     // 手机型号
36     NSString *phoneModel = [[UIDevice currentDevice] model];
37     NSLog(@"手机型号: %@",phoneModel );
38     
39     // 地方型号
40     NSString *localizedModel = [[UIDevice currentDevice] localizedModel];
41     NSLog(@"地方型号: %@",localizedModel);

尊重作者劳动成果,转载请注明: 【kingdev】

获取手机参数

标签:

原文地址:http://www.cnblogs.com/xiu619544553/p/5300682.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!