1. 程式人生 > >iOS獲取當前裝置ID、版本號、build號

iOS獲取當前裝置ID、版本號、build號

廢話不多說、直接上程式碼

//獲取裝置ID
NSString *identifierForVendor = [[UIDevice currentDevice].identifierForVendor UUIDString]; 
NSLog(@"%@",identifierForVendor);

//獲取專案版本號----------------------------------------------------
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    NSString *version = [infoDictionary objectForKey:@"CFBundleShortVersionString"
];//app版本號 Version NSString *build = [infoDictionary objectForKey:@"CFBundleVersion"];//app的build號 NSLog(@"版本號:%@\nbuild號:%@\n",version,build); //----------------------------------------------------------------