iOS具体的设备型号:

#include <sys/types.h>
#include <sys/sysctl.h>
- (void)test {
//手机型号。 size_t size; sysctlbyname("hw.machine", NULL, &size, NULL, ); char *machine = (char*)malloc(size); sysctlbyname("hw.machine", machine, &size, NULL, ); NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding];
NSLog(@"%@",platform);
//这里得到的platform是个设备型号。 比如iphone5,2. //所以如果想更完美点,可以自己根据字符串判断。 //比如: if ([platform isEqualToString:@"iPhone3,1"]) return @"iPhone 4";
//注:模拟器上运行得到的不同
}

UIDevice:获取手机属性

- (void)device {

    //    [[UIDevice currentDevice] systemName]; // 系统名
// [[UIDevice currentDevice] systemVersion]; //版本号
// [[UIDevice currentDevice] model]; //类型,模拟器,真机
// [[UIDevice currentDevice] name]; //设备名称
// [[UIDevice currentDevice] localizedModel]; // 本地模式
//设备相关信息的获取
NSString *strName = [[UIDevice currentDevice] name];
NSLog(@"设备名称:%@", strName);//e.g. "My iPhone" 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 ); //手机型号
}

NSBundle:获取应用名版本号

- (void)bundle {

    //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类型
}

NSLocale:获取机器当前语言和国家

-(void)locale {

    //Getting the User’s Language
NSArray *languageArray = [NSLocale preferredLanguages];
NSString *language = [languageArray objectAtIndex:];
NSLog(@"语言:%@", language); NSLocale *locale = [NSLocale currentLocale];
NSString *country = [locale localeIdentifier];
NSLog(@"国家:%@", country);
}
 

iOS获取手机相关信息的更多相关文章

  1. PHP获取手机相关信息

    该PHP操作类实现获取手机号手机头信息,取UA,取得手机类型,判断是否是opera,判断是否是m3gate,取得HA,取得手机IP 代码如下: <?php /** * @desc 手机操作类 获 ...

  2. ios开发-获取手机相关信息

    今天在做客户端的时候,里面有个意见反馈功能. 调用系统带的邮件功能,发送邮件到指定邮箱. 然后我就想,应该在邮件正文部分添加手机相关内容,比如型号,版本,应用程序的版本等等,这样不仅使用者方便,开发者 ...

  3. ios 获取手机相关的信息

    获取手机信息      应用程序的名称和版本号等信息都保存在mainBundle的一个字典中,用下面代码可以取出来 //获取版本号 NSDictionary *infoDict = [[NSBundl ...

  4. IOS 获取手机各种信息

    /手机序列号      NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];     NSLog(@&qu ...

  5. iOS 获取键盘相关信息

    一,在需要的地方添加监听 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onKeyboardWil ...

  6. iOS 获取APP相关信息 私有API

    /* Generated by RuntimeBrowser Image: /System/Library/Frameworks/MobileCoreServices.framework/Mobile ...

  7. ios 获取手机设备信息

    [UIDevice currentDevice]:表示设备 NSString *devices=[[NSString alloc] initWithFormat: @"unique id: ...

  8. iOS开发-Swift获取手机设备信息(UIDevice)

    使用UiDevice获取设备信息 获取设备名称 let name = UIDevice.currentDevice().name 获取设备系统名称 let systemName = UIDevice. ...

  9. Expo大作战(三十九)--expo sdk api之 DocumentPicker,Contacts(获取手机联系人信息),Branch

    简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...

随机推荐

  1. gravity、layout_gravity、ayout_weight 区别及用法

    layout_gravity  表示组件自身在父组件中的位置. gravity             表示组件的子组件在组件中的位置. weight  意思是权重.比重,即当前控件在画布中所占的空间 ...

  2. bzoj 1862/1056 [HAOI2008]排名系统

    原题链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1862 很恶心的 一道题,我也不晓得自己是第几次写这题了%>_<%. 写了两种方 ...

  3. GoAhead 嵌入式web

    https://embedthis.com/goahead/ 入手了一个360  4g  wifi :使用jquery  .goahead Goahead webserver编辑 GoAhead We ...

  4. extjs panel自动滚动

    指定两个参数 height:600, autoScroll:true, http://bbs.csdn.net/topics/280012147

  5. MVC 初始 Log4net (一)

    以前没有使用过Log4net 插件来记录日志文件,今天研究了一下,算是有点小眉目了,只是简单的使用一下:来写一篇博客自己记录一下,希望大神们多多包涵,小伙伴多多给提些建议,相互学习,我也是初始阶段,有 ...

  6. 无法解决“Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”与“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”之间的冲突。正在随意选择“Newtonsoft.Jso

    今天的程序莫名报错:  无法解决“Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed” ...

  7. SharePoint 2010 RBS 安装和配置遇到的一个问题

    在按照微软官方的文档按照配置的时候遇到下面问题: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event ...

  8. skill-判断浏览器

    判断是ie浏览器还是火狐等标准浏览器 var ie=!+"\v1"; 因为ie浏览器不支持\v,也就是水平制表符,所以"\"符号会被忽略,前面的+号是把&quo ...

  9. P2763: [JLOI2011]飞行路线

    然而WA了呀,这道分层图,也是不明白为什么WA了=-= ; maxn=; points=; type node=record f,t,l:longint; end; var n,m,k,i,j,u,v ...

  10. P1643: [Usaco2007 Oct]Bessie's Secret Pasture 贝茜的秘密草坪

    呵呵呵呵呵,很水的DP,同时能够朴素枚举出来,这数据弱的 是 吃了尸米吧.. var n,i,j,k,l,ans:longint; begin readln(n); to trunc(sqrt(n)) ...