如何动态获取ios工程的Bundle version版本号,bundleID,appName

2025-03-21 18:49:54
推荐回答(2个)
回答1:

let info = Bundle.main.infoDictionary

下面是key
CFBundleDisplayName //appName

CFBundleIdentifier //appID

CFBundleShortVersionString //app version

CFBundleVersion //app build

在工程里找到 Info.plist, 右键->open as-> source code
里面有你想要的各种key

回答2:

[[NSBundle mainBundle] infoDictionary];