常用的设备及APP属性

310 查看

 
    //    IOS-获取Model(设备型号)、Version(设备版本号)、app(程序版本号)等
    NSLog(@"name: %@", [[UIDevice currentDevice] name]);
    NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
    NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
    NSLog(@"model: %@", [[UIDevice currentDevice] model]);
    NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
    
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    
    CFShow((__bridge CFTypeRef)(infoDictionary));
    
    // app名称
    NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
    NSLog(@"name: %@", app_Name);

    // app版本
    NSString *app_Version = ;
    NSLog(@"name: %@", app_Version);

    // app build版本
    NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion”];


UIDevice *device = [UIDevice currentDevice];
    float sysVersion = [device.systemVersion floatValue];