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. java数据结构和算法------合并排序

      package iYou.neugle.sort; public class Merge_sort { public static void MergeSort(double[] array, i ...

  2. How to insert a character into a NSString

    How do I insert a space to a NSString. I need to add a space at index 5 into: NString * dir = @" ...

  3. Leetcode-Construct Binary Tree from inorder and preorder travesal

    Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that ...

  4. asp.net 操作word

    参考一:点击这里 参考二:点击这里 参考三:点击这里 using System; using System.Web.Security; using Microsoft.Office.Interop.W ...

  5. Node.js 学习(六)Node.js EventEmitter

    Node.js 所有的异步 I/O 操作在完成时都会发送一个事件到事件队列. Node.js里面的许多对象都会分发事件:一个net.Server对象会在每次有新连接时分发一个事件, 一个fs.read ...

  6. 14、到底改如何区分android的平板、电视、手机

    在没有出现android电视之前,如果要区分平板和手机有很多种方法: 方法1:看是否有通话功能 public boolean isTabletDevice() { TelephonyManager t ...

  7. Entity Framework技术导游系列开篇与热身

    在微软平台写程序有年头了,随着微软数据存取技术的持续演化,我在程序中先后使用过ODBC.DAO.ADO.ADO.NET.LINQ to SQL. Entity Framework这些技术. 近几年来, ...

  8. Zabbix全方位告警接入-电话/微信/短信都支持

    百度告警平台地址: http://gaojing.baidu.com 联系我们: 邮箱:gaojing@baidu.com 电话:13924600771 QQ群:183806029 对于使用zabbi ...

  9. 深入浅出谈4G ─ 4G LTE网速到底有多快?

    常说4G网速能达100MHz,实际感受远远没有这么快.今天和大家一起算算帐,算算4G LTE网速到底有多快. 基本概念1:资源粒子 个资源粒子就是用个子载波传送个OFDM符号. 1个子载波的带宽是15 ...

  10. android 自动化压力测试-monkey 2 获取程序包名

    monkey 1 中我们写到: C:\Users\chenshan>adb shell shell@hwG750-T20:/ $ monkey -p cn.emoney.acg -v 500 说 ...