iOS 怎样获得设备及应用相关信息

  UIDevice *device = [[UIDevice alloc] init];
    NSLog(@"设备所有者名称  %@  ",device.name);//设备所有者名称
    NSLog(@"设备类别  %@",device.model);//设备类别
    NSLog(@"本地化版本  %@",device.localizedModel);//本地化版本
    NSLog(@"当前系统版本  %@",device.systemVersion);//当期版本
    NSLog(@"当前系统  %@",device.systemName);//当前系统
    NSLog(@"系统唯一标示符  %@",[[[UIDevice currentDevice ] identifierForVendor] UUIDString]);//唯一标示
    NSLog(@"电量   %f",[[UIDevice currentDevice] batteryLevel]);//输出-1为模拟器  输出0-1为真机
    

     NSArray *languageArray = [NSLocale preferredLanguages];
    for (NSString *language in languageArray) {
        NSLog(@"语言:%@", language);//语言

    }


    NSLocale *locale = [NSLocale currentLocale];
    NSString *country = [locale localeIdentifier];
    NSLog(@"国家:%@", country); //国别
    
  
    //分辨率
    CGFloat scale_screen = [UIScreen mainScreen].scale;
    NSLog(@"screen w:%f",width*scale_screen);
    NSLog(@"screen h:%f",height*scale_screen);
    
    //获得运营商信息
    CTTelephonyNetworkInfo *info = [[CTTelephonyNetworkInfo alloc] init];
 
    NSLog(@"info  %@", info);

    //  获取运行商的名称
    CTCarrier *carrier = [info subscriberCellularProvider];
    NSString *mCarrier = [NSString stringWithFormat:@"%@",[carrier carrierName]];
    NSLog(@"%@", mCarrier);

    //app应用相关信息的获取
    NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];
    NSLog(@"应用所有信息 %@",dicInfo);
    NSString *strAppName = [dicInfo objectForKey:@"CFBundleDisplayName"];
    NSLog(@"App应用名称:%@", strAppName);
    NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];
    NSLog(@"App应用版本:%@", strAppVersion);
    NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];
    NSLog(@"App应用Build版本:%@", strAppBuild);
    NSString *strAppBundleIdentifier = [dicInfo objectForKey:@"CFBundleIdentifier"];
    NSLog(@"App应用唯一标示符:%@", strAppBundleIdentifier);
    NSLog(@"wanluo:%@",info.currentRadioAccessTechnology);
   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值