获取iphone手机相关信息

导入#import

NSString *strName = [[UIDevice currentDevice] name];

NSLog(@"设备名称:%@", strName);//e.g. "My iPhone"

NSString *udid =[[UIDevice currentDevice] uniqueDeviceIdentifier];

NSLog(@"设备唯一标识:%@", udid);//UUID,5.0后不可用

NSString *strSysName = [[UIDevice currentDevice] systemName];

NSLog(@"系统名称:%@", strSysName);// e.g. @"iOS"

NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];

NSLog(@"系统版本号:%@", strSysVersion);// e.g. @"4.0"

NSString *strModel = [[UIDevice currentDevice] model];

NSLog(@"设备模式:%@", strModel);// e.g. @"iPhone", @"iPod touch"

NSString *strLocModel = [[UIDevice currentDevice] localizedModel];

NSLog(@"本地设备模式:%@", strLocModel);// localized version of model //地方型号  (国际化区域名称)

NSString* phoneModel = [[UIDevice currentDevice] model];

NSLog(@"手机型号: %@",phoneModel );  //手机型号

//app应用相关信息的获取

NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];

// CFShow(dicInfo);

NSString *strAppName = [dicInfo objectForKey:@"CFBundleDisplayName"];

NSLog(@"App应用名称:%@", strAppName);  // 当前应用名称

NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];

NSLog(@"App应用版本:%@", strAppVersion);    // 当前应用软件版本  比如:1.0.1

NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];

NSLog(@"App应用Build版本:%@", strAppBuild);      // 当前应用版本号码  int类型

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容