美文网首页
获取手机硬件信息,APP信息(UUID,应用版本等)

获取手机硬件信息,APP信息(UUID,应用版本等)

作者: Elvist | 来源:发表于2016-05-29 13:16 被阅读533次
    获取设备信息
    NSLog(@"设备所有者 %@", [UIDevice currentDevice].name);
    NSLog(@"设备类型   %@", [UIDevice currentDevice].model);
    NSLog(@"本地化版本 %@", [UIDevice currentDevice].localizedModel);
    NSLog(@"当前系统版本 %@", [UIDevice currentDevice].systemVersion);
    NSLog(@"当前系统   %@", [UIDevice currentDevice].systemName);
    NSLog(@"UUID      %@", [[[UIDevice currentDevice] identifierForVendor] UUIDString]);
    NSLog(@"电量      %f", [[UIDevice currentDevice] batteryLevel]);  // -1为模拟器,0-1为真机
    

    获取本地相关设置
    NSArray *languageArray = [NSLocale preferredLanguages];
    NSLog(@"语言: %@", [languageArray objectAtIndex:0]);
        
    NSLocale *locale = [NSLocale currentLocale];
    NSLog(@"国家: %@", [locale localeIdentifier]);
    

    APP相关信息
    NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
    NSLog(@"所有应用信息 %@", info);
    NSLog(@"APP应用名称  %@", info[@"CFBundleDisplayName"]);
    NSLog(@"APP应用版本  %@", info[@"CFBundleVersionString"]);
    NSLog(@"APP应用Build版本  %@", info[@"CFBundleVersion"]);
    NSLog(@"APP应用唯一标识    %@", info[@"CFBundleIdentifier"]);
    

    相关文章

      网友评论

          本文标题:获取手机硬件信息,APP信息(UUID,应用版本等)

          本文链接:https://www.haomeiwen.com/subject/pxrqdttx.html