IOS 获取系统信息
2016-05-22 18:48
363 查看
IOS-获取Model(设备型号)、Version(设备版本号)、app(程序版本号)等
// app名称
NSString *app_Name1 = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
NSString *app_Name = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]];
NSString *app_Name2 = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleExecutableKey]];
NSLog(@"==============1%@-----%@---%@",app_Name1,app_Name,app_Name2);
// app版本
NSString *app_Version1 = [NSString stringWithFormat:@"v%@",
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey]];
NSString *app_Version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSLog(@"==============1%@---%@",app_Version1,app_Version);
// app build版本
NSString *app_build1 = [NSString stringWithFormat:@"v%@",
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]];
NSString *app_build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
NSLog(@"==============1%@---%@",app_build1,app_build);
//ios获取系统信息
//NSLog(@"identifier: %@", [[UIDevice currentDevice] identifierForVendor]);
//NSLog(@"name: %@", [[UIDevice currentDevice] name]);
//NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
//NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
//NSLog(@"model: %@", [[UIDevice currentDevice] model]);
//NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
[[UIScreen mainScreen] scale]详解
当屏幕分别为640x940时[[UIScreen mainScreen] scale]=2.0
当屏幕分别为320x480时[[UIScreen mainScreen] scale]=1.0
// app名称
NSString *app_Name1 = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
NSString *app_Name = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]];
NSString *app_Name2 = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleExecutableKey]];
NSLog(@"==============1%@-----%@---%@",app_Name1,app_Name,app_Name2);
// app版本
NSString *app_Version1 = [NSString stringWithFormat:@"v%@",
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*) kCFBundleVersionKey]];
NSString *app_Version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
NSLog(@"==============1%@---%@",app_Version1,app_Version);
// app build版本
NSString *app_build1 = [NSString stringWithFormat:@"v%@",
[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]];
NSString *app_build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
NSLog(@"==============1%@---%@",app_build1,app_build);
//ios获取系统信息
//NSLog(@"identifier: %@", [[UIDevice currentDevice] identifierForVendor]);
//NSLog(@"name: %@", [[UIDevice currentDevice] name]);
//NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
//NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
//NSLog(@"model: %@", [[UIDevice currentDevice] model]);
//NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
[[UIScreen mainScreen] scale]详解
当屏幕分别为640x940时[[UIScreen mainScreen] scale]=2.0
当屏幕分别为320x480时[[UIScreen mainScreen] scale]=1.0
相关文章推荐
- IOS入门-TargetAction
- iOS_socket_switch
- iOSCoreAnimation动画系列教程(一):CABasicAnimation【包会】
- iOS下KVO使用过程中的陷阱
- iOS容易造成循环引用的三种场景,就在你我身边!
- Github系列之二:开源 一行代码实现多形式多动画的推送小红点WZLBadge(iOS)
- ios如何弄遮罩
- CodingNet - Learning - 3
- iOS 生成本地验证码
- IOS之地图详解
- IOS-百度地图API用点生成线路、导航、自定义标注 2013年11月更新
- iOS开发经验1.1
- iOS类目
- iOS逆向工程读书笔记
- ios学习笔记之八--按钮控制图片放大缩小
- IOS集成环信时---Undefined symbols for architecture x86_64:
- iOS 异步图片加载优化与常用开源库分析
- IOS抓包
- iOS开发的几个小问题(二)
- iOS开发(OC)——AFNetworking之文件下载