ios-[NSBundle mainBundle] infoDictionary获取到的是当前程序的信息,通过控制台打印出下面这些信息

{
    BuildMachineOSBuild = 16B2657; //mac 版本
    CFBundleDevelopmentRegion = en; //本地化设置,默认为en
    CFBundleExecutable = UpdateTip; //安装包名称
    CFBundleIdentifier = “com.hcb.UpdateTip”; //bundle id
    CFBundleInfoDictionaryVersion = “6.0”; //info.plist格式化版本号
    CFBundleName = UpdateTip; //程序名称
    CFBundleNumericVersion = 16809984; //bundle版本
    CFBundlePackageType = APPL; //包类型
    CFBundleShortVersionString = “1.0”; //版本号
    CFBundleSupportedPlatforms = (
                                  iPhoneSimulator
                                  ); //支持的平台
    CFBundleVersion = 1; //版本号
    DTCompiler = “com.apple.compilers.llvm.clang.1_0”;
    DTPlatformBuild = “”; //运行平台
    DTPlatformName = iphonesimulator; //当前运行平台名称
    DTPlatformVersion = “10.2”; //平台版本
    DTSDKBuild = 14C89; //模拟器系统版本
    DTSDKName = “iphonesimulator10.2”; //模拟器系统名称
    DTXcode = 0821; //xcode
    DTXcodeBuild = 8C1002; //xcode版本
    LSRequiresIPhoneOS = 1; //是否只运行在iphone中
    MinimumOSVersion = “8.0”;//支持最低系统版本
    UIDeviceFamily = (
                      1
                      );
    UILaunchStoryboardName = LaunchScreen;
    UIMainStoryboardFile = Main; //MainStoryboard文件
    UIRequiredDeviceCapabilities = (
                                    armv7
                                    ); //针对哪些指令集进行编译
    UISupportedInterfaceOrientations = (
                                        UIInterfaceOrientationPortrait,
                                        UIInterfaceOrientationLandscapeLeft,
                                        UIInterfaceOrientationLandscapeRight
                                        ); //支持屏幕旋转方向
}

使用说明
//1.获取app的info.plist详细信息

//build 版本号
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
//version 版本号
NSString *version2 = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];

//应用标识:Bundle identifier
NSString *bundleId = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];

//Bundle name
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];

//应用展示的名字
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

//2.应用程序语言本地化
//app本地化宏
#define XLocalizedString(key, comment)        [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]

你可能感兴趣的:(ios-[NSBundle mainBundle] infoDictionary获取到的是当前程序的信息,通过控制台打印出下面这些信息)