iOS如何获取设备硬件信息
2015-12-23 17:31
621 查看
[[UIDevicecurrentDevice]
systemName];
[[UIDevicecurrentDevice]
systemVersion];//os version
[[UIDevicecurrentDevice] uniqueIdentifier];
[[UIDevicecurrentDevice]
model];
[[UIDevicecurrentDevice]
name];
真机输出:
System Name: iPhone OS
System Version: 5.6.3
Unique ID: 4b5dded78d5f5ac96750f8b4af0e46f40b96ea6d
Model: iPhone
Name: “seven”的 iPhone
参考:
//手机序列号
NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];
NSLog(@"手机序列号: %@",identifierNumber);
//手机别名: 用户定义的名称
NSString* userPhoneName = [[UIDevice currentDevice] name];
NSLog(@"手机别名: %@", userPhoneName);
//设备名称
NSString* deviceName = [[UIDevice currentDevice] systemName];
NSLog(@"设备名称: %@",deviceName );
//手机系统版本
NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];
NSLog(@"手机系统版本: %@", phoneVersion);
//手机型号
NSString* phoneModel = [[UIDevice currentDevice] model];
NSLog(@"手机型号: %@",phoneModel );
//地方型号 (国际化区域名称)
NSString* localPhoneModel = [[UIDevice currentDevice] localizedModel];
NSLog(@"国际化区域名称: %@",localPhoneModel );
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
// 当前应用名称
NSString *appCurName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
NSLog(@"当前应用名称:%@",appCurName);
// 当前应用软件版本 比如:1.0.1
NSString *appCurVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
NSLog(@"当前应用软件版本:%@",appCurVersion);
// 当前应用版本号码 int类型
NSString *appCurVersionNum = [infoDictionary objectForKey:@"CFBundleVersion"];
NSLog(@"当前应用版本号码:%@",appCurVersionNum);
2012-10-19 14:07:47.622 myDemo[5779:707] 手机序列号: 6685c75e34104be0b04c6ceb72985dc381f0f746
2012-10-19 14:07:47.624 myDemo[5779:707] 手机别名: “spring sky”的 iPod
2012-10-19 14:07:47.627 myDemo[5779:707] 设备名称: iPhone OS
2012-10-19 14:07:47.629 myDemo[5779:707] 手机系统版本: 5.1.1
2012-10-19 14:07:47.641 myDemo[5779:707] 手机型号: iPod touch
2012-10-19 14:07:47.642 myDemo[5779:707] 国际化区域名称: iPod touch
2012-10-19 14:07:47.643 myDemo[5779:707] 当前应用名称:myDemo
2012-10-19 14:07:47.645 myDemo[5779:707] 当前应用软件版本:1.0.1
systemName];
[[UIDevicecurrentDevice]
systemVersion];//os version
[[UIDevicecurrentDevice] uniqueIdentifier];
[[UIDevicecurrentDevice]
model];
[[UIDevicecurrentDevice]
name];
真机输出:
System Name: iPhone OS
System Version: 5.6.3
Unique ID: 4b5dded78d5f5ac96750f8b4af0e46f40b96ea6d
Model: iPhone
Name: “seven”的 iPhone
参考:
//手机序列号
NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];
NSLog(@"手机序列号: %@",identifierNumber);
//手机别名: 用户定义的名称
NSString* userPhoneName = [[UIDevice currentDevice] name];
NSLog(@"手机别名: %@", userPhoneName);
//设备名称
NSString* deviceName = [[UIDevice currentDevice] systemName];
NSLog(@"设备名称: %@",deviceName );
//手机系统版本
NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];
NSLog(@"手机系统版本: %@", phoneVersion);
//手机型号
NSString* phoneModel = [[UIDevice currentDevice] model];
NSLog(@"手机型号: %@",phoneModel );
//地方型号 (国际化区域名称)
NSString* localPhoneModel = [[UIDevice currentDevice] localizedModel];
NSLog(@"国际化区域名称: %@",localPhoneModel );
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
// 当前应用名称
NSString *appCurName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
NSLog(@"当前应用名称:%@",appCurName);
// 当前应用软件版本 比如:1.0.1
NSString *appCurVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
NSLog(@"当前应用软件版本:%@",appCurVersion);
// 当前应用版本号码 int类型
NSString *appCurVersionNum = [infoDictionary objectForKey:@"CFBundleVersion"];
NSLog(@"当前应用版本号码:%@",appCurVersionNum);
2012-10-19 14:07:47.622 myDemo[5779:707] 手机序列号: 6685c75e34104be0b04c6ceb72985dc381f0f746
2012-10-19 14:07:47.624 myDemo[5779:707] 手机别名: “spring sky”的 iPod
2012-10-19 14:07:47.627 myDemo[5779:707] 设备名称: iPhone OS
2012-10-19 14:07:47.629 myDemo[5779:707] 手机系统版本: 5.1.1
2012-10-19 14:07:47.641 myDemo[5779:707] 手机型号: iPod touch
2012-10-19 14:07:47.642 myDemo[5779:707] 国际化区域名称: iPod touch
2012-10-19 14:07:47.643 myDemo[5779:707] 当前应用名称:myDemo
2012-10-19 14:07:47.645 myDemo[5779:707] 当前应用软件版本:1.0.1
相关文章推荐
- iOS的绘图机制
- iOS字符串的大小写互相转换
- iOS如何从一个界面返回到指定界面?
- iOS CoreAnimation专题——原理篇(三) CALayer的模型层与展示层
- iOS中强制转换
- iOS中消息的传递机制
- iOS使用NSMutableAttributedString 实现富文本(不同颜色字体、划线等等)
- iOS如何隐藏NavigationBar
- IOS开发微博中涉及到的一些正则表达式(表情,话题,链接,@)
- iOS 深浅拷贝
- iOS开发简单的实现后台任务(诸如后台播放音乐,定时器等)
- iOS在Xcode中,文件名后小方框中的A(M或C)代表的意思
- iOS AES加密解密实现方法
- iOS如何使屏幕一直保持亮屏?
- IOS手势操作
- iOS开发-CoreMotion框架(加速计和陀螺仪)
- iOS AES128 CBC No Padding加密解密
- iOS 开发项目之 QQ 音乐
- IOS block简单使用
- 开源中国iOS客户端学习——(十一)AES加密