ios获取app一样版本信息 & 获取设备的基本信息

  • 获取手机应用的版本信息
NSDIctionary *infoDictionary = [[NSBundle mainBundel]infoDictionary];
NSString *name = [infoDictionary objectForKey:@"CFBundleName"];
NSString *version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
NSString *build = [infoDictionary objectForKey:@"CFBundleVersion"];
NSLog(@"%@,%@,%@,%@",infoDictionay,name,version,build);
  • 获取设备的基本信息
    通过UIDevice类的对象,可以获取IOS设备如下的信息
    UIDevice的属性:
@property(nonatomic ,readonly,strong) NSString *name //设备的名称,如xxx的iPhone6s
@property(nonatomic ,readonly ,strong)NSString *model;//设备的类型,例如 iPhone iPad touch
@property(nanatomic,readonly,strong)NSString *localizedModel; //localized version of model
@property(nonatomic,readonly,strong)NSString *systemVersion; //操作系统的版本号 如 8,3 9.2等
//获取设备的基本信息
通过UIDevice类的对象,可以获取ios设备如下的信息]
UIDevice *device = [UIDevice currentDevice];
NSLog(@"%@",device.name);
NSLog(@"%@",device.model);
NSLog(@"%@",device.localizedModel);
NSLog(@"%@",device.systemVersion);
//获取设备的UUID
NSLog(@"%@",device.identifierForVendor.UUIDString);

转自 http://www.jianshu.com/p/9a673c22af31

你可能感兴趣的:(ios获取app一样版本信息 & 获取设备的基本信息)