IOS获取当前版本号 Bundle ID等信息的方法详解

复制代码
本人亲测有效!更多交流可以家魏鑫:lixiaowu1129,公重好:iOS过审汇总,一起探讨iOS技术!

IOS获取当前版本号 Bundle ID等信息的方法

1:获取bundle Id信息:\[NSBundle mainBundlebundleIdentifier];

2:获取版本号:\[\[NSBundle mainBundleinfoDictionary] objectForKey:@"CFBundleShortVersionString"];

3:获取build号:\[\[NSBundle mainBundleinfoDictionary] objectForKey:@"CFBundleVersion"];

4:获取App显示名:\[\[NSBundle mainBundleinfoDictionary] objectForKey:@"CFBundleDisplayName"];

其实 \[NSBundle mainBundleinfoDictionary] 获得的是一个字典,里边放着Info.plist文件中的各种信息,根据不同的键去即可,如:

objectivec 复制代码
CFBundleDevelopmentRegion 

  CFBundleDisplayName 

  CFBundleExecutable

  CFBundleExecutablePath

  CFBundleIdentifier

  CFBundleInfoDictionaryVersion = "6.0";

  CFBundleInfoPlistURL

  CFBundleName

  CFBundlePackageType 

  CFBundleShortVersionString

  CFBundleSignature 

 CFBundleSupportedPlatforms
相关推荐
碎_浪11 小时前
Mac 壁纸被 MDM 锁住?我做了个 2MB 的开源方案
macos·开源·swift
2501_9160088913 小时前
iOS 证书管理最佳实践 从创建到续期的完整指南
android·ios·小程序·https·uni-app·iphone·webview
黑科技iOS上架1 天前
ReactNative入门介绍
经验分享·ios
智塑未来1 天前
鸿蒙系统对比安卓、iOS,核心优势是什么?
android·ios·harmonyos
初雪云1 天前
iOS 上架入门:证书、描述文件、IPA 上传到底是什么关系?
android·ios·自动化·产品经理·iphone
狂热开发者1 天前
用 Typeoff 把会后口述整理成 Markdown 决策记录
人工智能·windows·macos·ios·安卓
小牛不牛的程序员1 天前
开源一个 macOS 剪贴板「意图识别」工具——不只是存储,更是理解你复制了什么
macos·swift
2501_916007471 天前
iPad 怎么抓包 从代理模式到暴力抓包的操作方法
android·ios·小程序·uni-app·代理模式·iphone·ipad
2501_915918411 天前
PerfDog 太贵?iOS 性能监控工具的功能对比与选择
android·ios·小程序·https·uni-app·iphone·webview
MDM.Plus2 天前
苹果MDM技术演进:从远程控制到设备信任体系的构建
运维·服务器·安全·ios·mdm·手机店