美文网首页
获取app版本号相关信息

获取app版本号相关信息

作者: 失忆的程序员 | 来源:发表于2018-11-02 17:56 被阅读18次

    NSDictionary*infoDictionary = [[NSBundlemainBundle]infoDictionary];

    // app名称

    NSString*app_Name = [infoDictionaryobjectForKey:@"CFBundleDisplayName"];

    XPFLog(@"app名称 %@", app_Name);

    // app版本

    NSString*app_Version = [infoDictionaryobjectForKey:@"CFBundleShortVersionString"];

    XPFLog(@"app版本 %@", app_Version);

    // app build版本

    NSString*app_build = [infoDictionaryobjectForKey:@"CFBundleVersion"];

    XPFLog(@"app build版本 %@", app_build); 

    //手机序列号

    //NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];

    //NSLog(@"手机序列号: %@",identifierNumber);

    //手机别名: 用户定义的名称

    NSString* userPhoneName = [[UIDevicecurrentDevice]name];

    XPFLog(@"手机别名: %@", userPhoneName);

    //设备名称

    NSString* deviceName = [[UIDevicecurrentDevice]systemName];

    XPFLog(@"设备名称: %@",deviceName );

    //手机系统版本

    NSString* phoneVersion = [[UIDevicecurrentDevice]systemVersion];

    XPFLog(@"手机系统版本: %@", phoneVersion);

    //手机型号

    NSString* phoneModel = [[UIDevicecurrentDevice]model];

    XPFLog(@"手机型号: %@",phoneModel );

    //地方型号  (国际化区域名称)

    NSString* localPhoneModel = [[UIDevicecurrentDevice]localizedModel];

    XPFLog(@"国际化区域名称: %@",localPhoneModel );

    // 当前应用名称

    NSString*appCurName = [infoDictionaryobjectForKey:@"CFBundleDisplayName"];

    XPFLog(@"当前应用名称:%@",appCurName);

    // 当前应用软件版本  比如:1.0.1

    NSString*appCurVersion = [infoDictionaryobjectForKey:@"CFBundleShortVersionString"];

    XPFLog(@"当前应用软件版本:%@",appCurVersion);

    // 当前应用版本号码  int类型

    NSString*appCurVersionNum = [infoDictionaryobjectForKey:@"CFBundleVersion"];

    XPFLog(@"当前应用版本号码:%@",appCurVersionNum);

相关文章

网友评论

      本文标题:获取app版本号相关信息

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