iOS开发,如何获取手机设备号

该博客聚焦于iOS开发领域,主要介绍了获取手机设备号的相关内容,提供了技术支持与解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

iOS开发,获取手机设备号

//获取设备id号
    UIDevice *device = [UIDevice currentDevice];//创建设备对象
    NSString *deviceUID = [[NSString alloc] initWithString:device.identifierForVendor.UUIDString];
    
    NSLog(@"%@",deviceUID); // 输出设备id
    
    
    NSString *strmode = [UIDevice currentDevice].model;//模型
    NSLog(@"%@",strmode);
    NSString *strname = [UIDevice currentDevice].name;//设备名称设备主人可以更换
    NSLog(@"%@",strname);
    NSString *strlocalizedModel = [UIDevice currentDevice].localizedModel;//模型的当地版本
    NSLog(@"%@",strlocalizedModel);
    NSString *strsystemName = [UIDevice currentDevice].systemName;//设备名称
    NSLog(@"%@",strsystemName);
    NSString *strsystemVersion = [UIDevice currentDevice].systemVersion;//版本号
    NSLog(@"%@",strsystemVersion);
    

    NSUUID      *stridentifierForVendor =[UIDevice currentDevice].identifierForVendor;
    NSLog(@"%@",stridentifierForVendor);//uuid唯一标示
    UIDeviceOrientation strorientation = [UIDevice currentDevice].orientation;//设备方向
    NSLog(@"%ld",(long)strorientation);
    
    BOOL zbatteryMonitoringEnabled = [UIDevice currentDevice].batteryMonitoringEnabled;//电池监控启用
    NSLog(@"%hhd",zbatteryMonitoringEnabled);
    
    float abatteryLevel  = [UIDevice currentDevice].batteryLevel;//设备电池状态,电池级
    NSLog(@"%f",abatteryLevel);

技术支持-解决方案

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值