博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何判断iOS设备硬件型号
阅读量:4198 次
发布时间:2019-05-26

本文共 1949 字,大约阅读时间需要 6 分钟。

方法1:

#include <sys/sysctl.h>

- (NSString *) platform

{  
    size_t size;  
    sysctlbyname("hw.machine",NULL, &size, NULL,0);  
    char *machine = malloc(size);  
    sysctlbyname("hw.machine", machine, &size,NULL, 0);  
    NSString*platform = [NSStringstringWithCString:machineencoding:NSUTF8StringEncoding];  
    free(machine);  
    return platform;  
}

方法2:

#import <sys/utsname.h>

NSString*machineName()

{

struct utsname systemInfo;

uname(&systemInfo);

return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];

}

逗号后面数字解释:(i386是指模拟器)
1-WiFi版
2-GSM/WCDMA 3G版
3-CDMA版

仅供参考:

AppleTV(2G)    (AppleTV2,1)

iPad           (iPad1,1)
iPad2,1        (iPad2,1)Wifi版
iPad2,2        (iPad2,2)GSM3G版
iPad2,3        (iPad2,3)CDMA3G版
iPhone         (iPhone1,1)
iPhone3G       (iPhone1,2)
iPhone3GS      (iPhone2,1)
iPhone4        (iPhone3,1)
iPhone4(vz)    (iPhone3,3)iPhone4 CDMA版
iPhone4S       (iPhone4,1)
iPodTouch(1G)  (iPod1,1)
iPodTouch(2G)  (iPod2,1)
iPodTouch(3G)  (iPod3,1)

iPodTouch(4G)  (iPod4,1)

仅供参考:

@"i386" on the simulator

@"iPod1,1" on iPod Touch

@"iPod2,1" on iPod Touch Second Generation

@"iPod3,1" on iPod Touch Third Generation

@"iPod4,1" on iPod Touch Fourth Generation

@"iPhone1,1" on iPhone

@"iPhone1,2" on iPhone 3G

@"iPhone2,1" on iPhone 3GS

@"iPad1,1" on iPad

@"iPad2,1" on iPad 2

@"iPad3,1" on 3rd Generation iPad

@"iPhone3,1" on iPhone 4

@"iPhone4,1" on iPhone 4S

@"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)

@"iPhone5,2" on iPhone 5 (model A1429, everything else)

@"iPad3,4" on 4th Generation iPad@"iPad2,5" on iPad Mini

@"iPhone5,3" on iPhone 5c (model A1456, A1532 | GSM)

@"iPhone5,4" on iPhone 5c (model A1507, A1516, A1526 (China), A1529 | Global)

@"iPhone6,1" on iPhone 5s (model A1433, A1533 | GSM)

@"iPhone6,2" on iPhone 5s (model A1457, A1518, A1528 (China), A1530 | Global)

@"iPad4,1" on 5th Generation iPad (iPad Air) - Wifi

@"iPad4,2" on 5th Generation iPad (iPad Air) - Cellular

@"iPad4,4" on 2nd Generation iPad Mini - Wifi

@"iPad4,5" on 2nd Generation iPad Mini - Cellular

 

PS:

附上IOS不同设备的参数URL

 

转载地址:http://ywzli.baihongyu.com/

你可能感兴趣的文章
x265 视频编码默认参数
查看>>
ffmpeg 视频倍速播放 和 慢速播放
查看>>
x264 高级编码参数
查看>>
ffmpeg 分析两个视频的 psnr 和 ssim
查看>>
Docker 容器化技术介绍(十) 之 Docker 挂载本地目录
查看>>
ffmpeg 实现 视频与gif互转
查看>>
Android 按钮响应点击事件的三种实现方式
查看>>
常见视频格式有哪些?
查看>>
阿里云 人脸识别 测试
查看>>
python图像处理库pillow
查看>>
视频黑屏画面检测 blackframe
查看>>
视频黑屏检测,时长检测 blackdetect
查看>>
ffmpeg 音频音量的获取
查看>>
ffmpeg 绘制音频波形图
查看>>
ffmpeg 生成单色测试视频
查看>>
python urllib 库下载 http文件
查看>>
ubuntu 或者 debian 安装 libpng
查看>>
ffmpeg 音量调整
查看>>
ffmpeg 视频截图
查看>>
docker 服务器启动失败
查看>>