zoukankan      html  css  js  c++  java
  • 获取手机参数

     1     // 应用名称
     2     NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
     3     NSString *appName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
     4     NSLog(@"应用名称:%@",appName);
     5     
     6     // 版本号
     7     NSString *shortVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
     8     NSLog(@"版本号:%@",shortVersion);
     9     
    10     // 版本号(int类型)
    11     NSString *version = [infoDictionary objectForKey:@"CFBundleVersion"];
    12     NSLog(@"版本号(int类型):%@",version);
    13     
    14     // 手机标识符
    15     NSUUID* identifierForVendor = [[UIDevice currentDevice] identifierForVendor];
    16     NSLog(@"手机标识符: %@",identifierForVendor);
    17     
    18     // 手机
    19     CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
    20     NSString *uuid = (NSString *)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault,uuidRef));
    21     NSLog(@"手机uuid: %@",uuid);
    22     
    23     // 系统
    24     NSString *systemName = [[UIDevice currentDevice] systemName];
    25     NSLog(@"系统: %@",systemName );
    26     
    27     // 手机系统版本
    28     NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
    29     NSLog(@"手机系统版本: %@", systemVersion);
    30     
    31     // 用户手机名
    32     NSString* phoneName = [[UIDevice currentDevice] name];
    33     NSLog(@"用户手机名: %@", phoneName);
    34     
    35     // 手机型号
    36     NSString *phoneModel = [[UIDevice currentDevice] model];
    37     NSLog(@"手机型号: %@",phoneModel );
    38     
    39     // 地方型号
    40     NSString *localizedModel = [[UIDevice currentDevice] localizedModel];
    41     NSLog(@"地方型号: %@",localizedModel);

    尊重作者劳动成果,转载请注明: 【kingdev】

  • 相关阅读:
    MySQL-安装mysql8
    MySQL-Prometheus
    MySQL-sysbench
    MySQL-客户端登录问题
    学习进度第十六周
    学习进度第十五周
    寻找最长单词链
    用户体验评价
    学习进度第十四周
    找水王问题
  • 原文地址:https://www.cnblogs.com/xiu619544553/p/5300682.html
Copyright © 2011-2022 走看看