iOS如何获取设备硬件信息

[[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


参考:

  1. //手机序列号  
  2.     NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];  
  3.     NSLog(@"手机序列号: %@",identifierNumber);  
  4.     //手机别名: 用户定义的名称  
  5.     NSString* userPhoneName = [[UIDevice currentDevice] name];  
  6.     NSLog(@"手机别名: %@", userPhoneName);  
  7.     //设备名称  
  8.     NSString* deviceName = [[UIDevice currentDevice] systemName];  
  9.     NSLog(@"设备名称: %@",deviceName );  
  10.     //手机系统版本  
  11.     NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];  
  12.     NSLog(@"手机系统版本: %@", phoneVersion);  
  13.     //手机型号  
  14.     NSString* phoneModel = [[UIDevice currentDevice] model];  
  15.     NSLog(@"手机型号: %@",phoneModel );  
  16.     //地方型号  (国际化区域名称)  
  17.     NSString* localPhoneModel = [[UIDevice currentDevice] localizedModel];  
  18.     NSLog(@"国际化区域名称: %@",localPhoneModel );  
  19.       
  20.     NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];  
  21.     // 当前应用名称  
  22.     NSString *appCurName = [infoDictionary objectForKey:@"CFBundleDisplayName"];  
  23.     NSLog(@"当前应用名称:%@",appCurName);  
  24.     // 当前应用软件版本  比如:1.0.1  
  25.     NSString *appCurVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];  
  26.     NSLog(@"当前应用软件版本:%@",appCurVersion);  
  27.     // 当前应用版本号码   int类型  
  28.     NSString *appCurVersionNum = [infoDictionary objectForKey:@"CFBundleVersion"];  
  29.     NSLog(@"当前应用版本号码:%@",appCurVersionNum); 
  1. 2012-10-19 14:07:47.622 myDemo[5779:707] 手机序列号: 6685c75e34104be0b04c6ceb72985dc381f0f746  
  2. 2012-10-19 14:07:47.624 myDemo[5779:707] 手机别名: “spring sky”的 iPod  
  3. 2012-10-19 14:07:47.627 myDemo[5779:707] 设备名称: iPhone OS  
  4. 2012-10-19 14:07:47.629 myDemo[5779:707] 手机系统版本: 5.1.1  
  5. 2012-10-19 14:07:47.641 myDemo[5779:707] 手机型号: iPod touch  
  6. 2012-10-19 14:07:47.642 myDemo[5779:707] 国际化区域名称: iPod touch  
  7. 2012-10-19 14:07:47.643 myDemo[5779:707] 当前应用名称:myDemo  
  8. 2012-10-19 14:07:47.645 myDemo[5779:707] 当前应用软件版本:1.0.1 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值