iOS 怎样获得设备及应用相关信息
2017-08-16 14:50
369 查看
UIDevice *device = [[UIDevice alloc] init];
NSLog(@"设备所有者名称 %@ ",device.name);//设备所有者名称
NSLog(@"设备类别 %@",device.model);//设备类别
NSLog(@"本地化版本 %@",device.localizedModel);//本地化版本
NSLog(@"当前系统版本 %@",device.systemVersion);//当期版本
NSLog(@"当前系统 %@",device.systemName);//当前系统
NSLog(@"系统唯一标示符 %@",[[[UIDevice currentDevice ] identifierForVendor] UUIDString]);//唯一标示
NSLog(@"电量 %f",[[UIDevice currentDevice] batteryLevel]);//输出-1为模拟器 输出0-1为真机
NSArray *languageArray = [NSLocale preferredLanguages];
for (NSString *language in languageArray) {
NSLog(@"语言:%@", language);//语言
}
NSLocale *locale = [NSLocale currentLocale];
NSString *country = [locale localeIdentifier];
NSLog(@"国家:%@", country); //国别
//分辨率
CGFloat scale_screen = [UIScreen mainScreen].scale;
NSLog(@"screen w:%f",width*scale_screen);
NSLog(@"screen h:%f",height*scale_screen);
//获得运营商信息
CTTelephonyNetworkInfo *info = [[CTTelephonyNetworkInfo alloc] init];
NSLog(@"info %@", info);
// 获取运行商的名称
CTCarrier *carrier = [info subscriberCellularProvider];
NSString *mCarrier = [NSString stringWithFormat:@"%@",[carrier carrierName]];
NSLog(@"%@", mCarrier);
//app应用相关信息的获取
NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];
NSLog(@"应用所有信息 %@",dicInfo);
NSString *strAppName = [dicInfo objectForKey:@"CFBundleDisplayName"];
NSLog(@"App应用名称:%@", strAppName);
NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];
NSLog(@"App应用版本:%@", strAppVersion);
NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];
NSLog(@"App应用Build版本:%@", strAppBuild);
NSString *strAppBundleIdentifier = [dicInfo objectForKey:@"CFBundleIdentifier"];
NSLog(@"App应用唯一标示符:%@", strAppBundleIdentifier);
NSLog(@"wanluo:%@",info.currentRadioAccessTechnology);
NSLog(@"设备所有者名称 %@ ",device.name);//设备所有者名称
NSLog(@"设备类别 %@",device.model);//设备类别
NSLog(@"本地化版本 %@",device.localizedModel);//本地化版本
NSLog(@"当前系统版本 %@",device.systemVersion);//当期版本
NSLog(@"当前系统 %@",device.systemName);//当前系统
NSLog(@"系统唯一标示符 %@",[[[UIDevice currentDevice ] identifierForVendor] UUIDString]);//唯一标示
NSLog(@"电量 %f",[[UIDevice currentDevice] batteryLevel]);//输出-1为模拟器 输出0-1为真机
NSArray *languageArray = [NSLocale preferredLanguages];
for (NSString *language in languageArray) {
NSLog(@"语言:%@", language);//语言
}
NSLocale *locale = [NSLocale currentLocale];
NSString *country = [locale localeIdentifier];
NSLog(@"国家:%@", country); //国别
//分辨率
CGFloat scale_screen = [UIScreen mainScreen].scale;
NSLog(@"screen w:%f",width*scale_screen);
NSLog(@"screen h:%f",height*scale_screen);
//获得运营商信息
CTTelephonyNetworkInfo *info = [[CTTelephonyNetworkInfo alloc] init];
NSLog(@"info %@", info);
// 获取运行商的名称
CTCarrier *carrier = [info subscriberCellularProvider];
NSString *mCarrier = [NSString stringWithFormat:@"%@",[carrier carrierName]];
NSLog(@"%@", mCarrier);
//app应用相关信息的获取
NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];
NSLog(@"应用所有信息 %@",dicInfo);
NSString *strAppName = [dicInfo objectForKey:@"CFBundleDisplayName"];
NSLog(@"App应用名称:%@", strAppName);
NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];
NSLog(@"App应用版本:%@", strAppVersion);
NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];
NSLog(@"App应用Build版本:%@", strAppBuild);
NSString *strAppBundleIdentifier = [dicInfo objectForKey:@"CFBundleIdentifier"];
NSLog(@"App应用唯一标示符:%@", strAppBundleIdentifier);
NSLog(@"wanluo:%@",info.currentRadioAccessTechnology);
相关文章推荐
- iOS 获取当前设备具体型号(当前支持到iPhone7/iPhone7P )、系统版本、电量、序列号、设备名称、应用相关信息获取等
- IOS获得设备信息的三个相关类
- IOS获得设备信息的三个相关类
- iOS获得设备相关信息,获取app相关信息
- 【IOS工具类】获得设备唯一标识,删除应用不重新生成
- 如何在ios设备上定位当前地点,并在地图上显示相关信息
- 如何获得ios设备中的硬件信息(下)
- 获得ios设备的一些信息
- iOS 获取本地设备相关信息,如:IP地址
- iOS获取设备信息与应用信息
- iOS获取设备信息与应用信息
- iOS获取应用和设备信息
- ios 获取设备相关的信息
- 三十一、Windows8 获得系统应用相关信息
- iOS 获取设备相关信息
- 获取ios应用的app相关信息
- iOS的应用中集成QQ第三方登录获取相关信息
- iOS开发获取设备唯一标识、系统版本、应用版本等信息
- iOS开发 获得设备UDID 手机别名 设备名称 应用名称等
- iOS开发小技巧 获取当前设备/应用程序相关信息