美文网首页
iOS OC 获取当前app的信息以及CFBundleDispl

iOS OC 获取当前app的信息以及CFBundleDispl

作者: 人间一流 | 来源:发表于2019-07-25 11:15 被阅读0次
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];

NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];
NSLog(@"手机序列号: %@",identifierNumber);

NSString* userPhoneName = [[UIDevice currentDevice] name];
NSLog(@"手机别名: %@", userPhoneName);

NSString* deviceName = [[UIDevice currentDevice] systemName];
NSLog(@"设备名称: %@",deviceName );

NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];
NSLog(@"手机系统版本: %@", phoneVersion);

NSString* phoneModel = [[UIDevice currentDevice] model];
NSLog(@"手机型号: %@",phoneModel );

NSString* localPhoneModel = [[UIDevice currentDevice] localizedModel];
NSLog(@"国际化区域名称: %@",localPhoneModel );

NSString *appCurName = [infoDictionary objectForKey:@"CFBundleDisplayName"];
NSLog(@"当前应用名称:%@",appCurName);
#发现获取到的appName为空,plist下以前默认创建的Bundle display name没有了:
#info.plist文件下添加 Bundle display name  ${PRODUCT_NAME}

NSString *appCurVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
NSLog(@"当前应用软件版本:%@",appCurVersion);

NSString *appCurVersionNum = [infoDictionary objectForKey:@"CFBundleVersion"];
NSLog(@"当前应用版本号码:%@",appCurVersionNum);

相关文章

网友评论

      本文标题:iOS OC 获取当前app的信息以及CFBundleDispl

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