NSLog(@"设备名称: %@",[UIDevice currentDevice].name);
NSLog(@"设备model: %@",[UIDevice currentDevice].model);
NSLog(@"设备localizedModel: %@",[UIDevice currentDevice].localizedModel);
NSLog(@"设备systemName: %@",[UIDevice currentDevice].systemName);
NSLog(@"设备systemVersion: %@",[UIDevice currentDevice].systemVersion);
NSLog(@"设备UUID: %@",[UIDevice currentDevice].identifierForVendor);
NSLog(@"设备orientation: %ld",[UIDevice currentDevice].orientation);
//打开检测电池状态
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
//需要在真机上面
NSLog(@"电池batteryState: %ld",[UIDevice currentDevice].batteryState);
NSLog(@"设备batteryLevel: %f",[UIDevice currentDevice].batteryLevel);
NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];
// CFShow(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);
NSArray *languageArray = [NSLocale preferredLanguages];
NSString *language = [languageArray objectAtIndex:0];
NSLog(@"语言:%@", language);//en
NSLocale *locale = [NSLocale currentLocale];
NSString *country = [locale localeIdentifier];
NSLog(@"国家:%@", country); //en_US
UIDevice的一些操作
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 大家总是说,酒后吐真言。不知你是hin赞同还是认为这是胡说八道?上周,在一场热闹的生日宴后,小S醉酒后发视频,对着...