NSLog(@"HostName: %@", [[NSProcessInfo processInfo] hostName]); //globallyUniqueString 唯一的标示符,每次调用都会不一样,可以用作一些临时缓存文件的名字 NSLog(@"GlobalUniqueString: %@", [[NSProcessInfo processInfo] globallyUniqueString]); //操作系统名称 NSLog(@"OperatingSystemName: %@", [[NSProcessInfo processInfo] operatingSystemName]); //操作系统版本 NSLog(@"OperatingSystemVersion: %@", [[NSProcessInfo processInfo] operatingSystemVersionString]); //物理内存 NSLog(@"PhysicalMem: %llu", [[NSProcessInfo processInfo] physicalMemory]); //进程名称 NSLog(@"ProcessName: %@", [[NSProcessInfo processInfo] processName]); //供应商标识 NSLog(@"UniqueId: %@", [UIDevice currentDevice].identifierForVendor); //设备类型(iPhone、iPad) NSLog(@"userInterfaceIdiom: %d", [UIDevice currentDevice].userInterfaceIdiom); //设备名字 NSLog(@"Name: %@", [UIDevice currentDevice].name); //系统名字 NSLog(@"SystemName: %@", [UIDevice currentDevice].systemName); //系统版本 NSLog(@"SystemVersion: %@", [UIDevice currentDevice].systemVersion); //模型 NSLog(@"Model: %@", [UIDevice currentDevice].model); //本地化的模型 NSLog(@"LocalizeModel: %@", [UIDevice currentDevice].localizedModel); //电池状态 NSLog(@"BatteryLevel: %f", [UIDevice currentDevice].batteryLevel); //判断设备是否是9.0以上系统 [[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0f 注意: //假如我们的设备版本号为9.1.1(为字符串类型),对其进行floatValue浮点化后值为9.100000。3. //判断设备是否是iPhone、iPad iPad:[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad iPhone: [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone UIUserInterfaceIdiom in UIDevice.h typedef NS_ENUM(NSInteger, UIUserInterfaceIdiom) { #if __IPHONE_3_2 <= __IPHONE_OS_VERSION_MAX_ALLOWED UIUserInterfaceIdiomPhone, // iPhone and iPod touch style UI UIUserInterfaceIdiomPad, // iPad style UI #endif };
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/3343.html