iOS获取设备型号

获取当前设备的型号,不依据屏幕size判断设备型号 如iPhone6 对应的deviceModelString: iPhone7,2

//需#import "sys/utsname.h"

- (NSString*)deviceModelString

{

struct utsname deviceInfo;

uname(&deviceInfo);

NSString * deviceModel = [NSString stringWithCString:deviceInfo.machine encoding:NSUTF8StringEncoding];

return deviceModel;

}

// NSString * model = [[UIDevice currentDevice] model]; 该方法只能判断 设备的类型(@"iPhone", @"iPod touch"),无法判断具体型号

时间: 2024-08-10 08:54:03

iOS获取设备型号的相关文章

iOS获取设备型号、装置类型等信息

iOS获取设备型号.设备类型等信息 设备标识 关于设备标识,历史上盛行过很多英雄,比如UDID.Mac地址.OpenUDID等,然而他们都陆陆续续倒在了苹果的门下.苹果目前提供了2个方法供App获取设备标识:idfa和idfv idfa:全称advertisingIdentifier,官方解释是广告标识,适用于广告推广,这个建议不要轻易使用,如果用了,则App里必须提供广告功能,否则很有可能会在AppStore审核时被拒.而且idfa是可以被用户关闭的(设置->隐私),一旦被关闭,就获取不到了.

iOS获取设备型号、设备类型等信息

设备标识 关于设备标识,历史上盛行过很多英雄,比如UDID.Mac地址.OpenUDID等,然而他们都陆陆续续倒在了苹果的门下.苹果目前提供了2个方法供App获取设备标识:idfa和idfv idfa:全称advertisingIdentifier,官方解释是广告标识,适用于广告推广,这个建议不要轻易使用,如果用了,则App里必须提供广告功能,否则很有可能会在AppStore审核时被拒.而且idfa是可以被用户关闭的(设置->隐私),一旦被关闭,就获取不到了. idfv:全称identifier

(转)iOS获取设备型号

//获得设备型号 + (NSString *)getCurrentDeviceModel:(UIViewController *)controller { int mib[2]; size_t len; char *machine; mib[0] = CTL_HW; mib[1] = HW_MACHINE; sysctl(mib, 2, NULL, &len, NULL, 0); machine = malloc(len); sysctl(mib, 2, machine, &len, NU

iOS获取设备型号的方法

1. [UIDevice currentDevice].model   自己写的看只抓到模拟器和iPhone.暂时不推荐. 2.自己写的找的方法再添加.直接  NSString * deviceModle= [selfdoDevicePlatform]; 即可获得?设备型号?- (NSString*) doDevicePlatform { size_t size; int nR = sysctlbyname("hw.machine", NULL, &size, NULL, 0)

iOS 获取设备型号 ip6更新

//获得设备型号 + (NSString *)getCurrentDeviceModel:(UIViewController *)controller { int mib[2]; size_t len; char *machine; mib[0] = CTL_HW; mib[1] = HW_MACHINE; sysctl(mib, 2, NULL, &len, NULL, 0); machine = malloc(len); sysctl(mib, 2, machine, &len, NU

iOS 获取设备型号,设备版本号,程序版本号

iOS 开发  常用到的方法 NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]); NSLog(@"name: %@", [[UIDevice currentDevice] name]); NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]); NSLog(@"sy

php获取设备型号

/* 获取设备型号 */ function get_device_type(){ $agent = strtolower($_SERVER['HTTP_USER_AGENT']); $type = 'other'; if(strpos($agent, 'iphone') || strpos($agent, 'ipad') ){ $type = 'ios'; } if(strpos($agent, 'android')){ $type = 'android'; } return $type; }

iOS获取设备唯一标识的8种方法

8种iOS获取设备唯一标识的方法,希望对大家有用. UDID UDID(Unique Device Identifier),iOS 设备的唯一识别码,是一个40位十六进制序列(越狱的设备通过某些工具可以改变设备的 UDID),移动网络可以利用 UDID 来识别移动设备. 许多开发者把 UDID 跟用户的真实姓名.密码.住址.其它数据关联起来,网络窥探者会从多个应用收集这些数据,然后顺藤摸瓜得到这个人的许多隐私数据,同时大部分应用确实在频繁传输 UDID 和私人信息. 为了避免集体诉讼,苹果最终决

转载-iOS获取设备IP地址

iOS获取设备IP地址 代码如下: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 #import <ifaddrs.h>#import <arpa/inet.h>#