iOS 获取设备相关信息

来源:互联网 发布:淘宝闲鱼小二介入规则 编辑:程序博客网 时间:2024/04/29 01:06
//设备相关信息的获取    NSString *IMEI = (NSString *)[[UIDevice currentDevice] identifierForVendor];    NSLog(@"设备唯一标识:%@", IMEI);//UUID,5.0后不可用    NSString *osVersion = [[UIDevice currentDevice] systemVersion];    NSLog(@"系统版本号:%@", osVersion);// e.g. @"4.0"    NSString* clientModel = [[UIDevice currentDevice] model];    NSLog(@"手机型号: %@",clientModel);   //手机型号    NSString * appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];    NSLog(@"App应用版本:%@", appVersion);    // 请求时间    NSDate * nowDate = [NSDate date];    NSInteger nowInterval = [nowDate timeIntervalSince1970];    nowInterval = nowInterval + 8 * 3600;    NSString * reqTime = [NSString stringWithFormat:@"%ld",(long)nowInterval];    NSLog(@"请求时间:%@", reqTime);
2016-03-08 11:17:41.236 MD5[1612:60b] 设备唯一标识:<__NSConcreteUUID 0x17da75e0> 3F7ADBB0-D4A5-4923-99ED-71D782CFE0852016-03-08 11:17:41.239 MD5[1612:60b] 系统版本号:7.1.22016-03-08 11:17:41.243 MD5[1612:60b] 手机型号: iPhone2016-03-08 11:17:41.247 MD5[1612:60b] App应用版本:1.02016-03-08 11:17:41.250 MD5[1612:60b] 请求时间:1457435861
0 0