查看bundleId和info.plist文件内容
2016-06-16 10:21
429 查看
/******** OC ********/
// 提取infoplist
NSDictionary * info = [NSBundle mainBundle].infoDictionary;
// 提取bundleID
NSString * bundleID = [NSBundle mainBundle].bundleIdentifier;
/******** C *********/
CFDictionaryRef info = CFBundleGetInfoDictionary(CFBundleGetMainBundle());
CFStringRef bundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
如下为新建的Xcode临时工程里面的infoPlist文件的东西
当然如果向infoplist文件中新添加一些新的配置,添加的配置同样能够打印出来[
"DTSDKName": iphoneos9.2,
"CFBundleSupportedPlatforms": (
iPhoneOS
),
"CFBundleIdentifier": com.ebeijia.tmp,
"UIMainStoryboardFile": Main, "CFBundleNumericVersion": 16809984, "CFBundleShortVersionString": 1.0,
"BuildMachineOSBuild": 15D21,
"UILaunchStoryboardName": LaunchScreen,
"DTCompiler": com.apple.compilers.llvm.clang.1_0,
"DTXcodeBuild": 7C1002,
"LSRequiresIPhoneOS": 1,
"UISupportedInterfaceOrientations": (
UIInterfaceOrientationPortrait,
UIInterfaceOrientationLandscapeLeft,
UIInterfaceOrientationLandscapeRight
),
"DTPlatformBuild": 13C75,
"CFBundleVersion": 1,
"UIRequiredDeviceCapabilities": (
arm64
),
"DTPlatformVersion": 9.2,
"CFBundleName": tmp,
"DTSDKBuild": 13C75,
"CFBundleInfoDictionaryVersion": 6.0,
"DTPlatformName": iphoneos,
"CFBundleSignature": ????,
"CFBundlePackageType": APPL,
"UIDeviceFamily": (
1
),
"CFBundleExecutable": tmp,
"DTXcode": 0721,
"CFBundleInfoPlistURL": Info.plist -- file:///var/mobile/Containers/Bundle/Application/F8DD872B-6926-490D-A0AF-A62ACBE65B19/tmp.app/,
"MinimumOSVersion": 9.2,
"CFBundleDevelopmentRegion": en]
// 提取infoplist
NSDictionary * info = [NSBundle mainBundle].infoDictionary;
// 提取bundleID
NSString * bundleID = [NSBundle mainBundle].bundleIdentifier;
/******** C *********/
CFDictionaryRef info = CFBundleGetInfoDictionary(CFBundleGetMainBundle());
CFStringRef bundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
// 打印所有infoplist文件内容 let info:[String:AnyObject] = NSBundle.mainBundle().infoDictionary! print(info) // 提取bundleID let bundleId = NSBundle.mainBundle().bundleIdentifier print(bundleId)
如下为新建的Xcode临时工程里面的infoPlist文件的东西
当然如果向infoplist文件中新添加一些新的配置,添加的配置同样能够打印出来[
"DTSDKName": iphoneos9.2,
"CFBundleSupportedPlatforms": (
iPhoneOS
),
"CFBundleIdentifier": com.ebeijia.tmp,
"UIMainStoryboardFile": Main, "CFBundleNumericVersion": 16809984, "CFBundleShortVersionString": 1.0,
"BuildMachineOSBuild": 15D21,
"UILaunchStoryboardName": LaunchScreen,
"DTCompiler": com.apple.compilers.llvm.clang.1_0,
"DTXcodeBuild": 7C1002,
"LSRequiresIPhoneOS": 1,
"UISupportedInterfaceOrientations": (
UIInterfaceOrientationPortrait,
UIInterfaceOrientationLandscapeLeft,
UIInterfaceOrientationLandscapeRight
),
"DTPlatformBuild": 13C75,
"CFBundleVersion": 1,
"UIRequiredDeviceCapabilities": (
arm64
),
"DTPlatformVersion": 9.2,
"CFBundleName": tmp,
"DTSDKBuild": 13C75,
"CFBundleInfoDictionaryVersion": 6.0,
"DTPlatformName": iphoneos,
"CFBundleSignature": ????,
"CFBundlePackageType": APPL,
"UIDeviceFamily": (
1
),
"CFBundleExecutable": tmp,
"DTXcode": 0721,
"CFBundleInfoPlistURL": Info.plist -- file:///var/mobile/Containers/Bundle/Application/F8DD872B-6926-490D-A0AF-A62ACBE65B19/tmp.app/,
"MinimumOSVersion": 9.2,
"CFBundleDevelopmentRegion": en]
相关文章推荐
- 教你如何解决XCODE升级后插件不能用问题
- 浅谈Xcode 开发工具 XCActionBar
- xcode 4 制作静态库图文详解
- 使用Xcode为iOS应用项目创建PCH文件的方法及应用示例
- 解决 Xcode 6-Beta2 智能提示bug
- 针对iOS开发的一些Xcode使用技巧小结
- Xcode中iOS应用开发的一般项目目录结构和流程简介
- XCode编译速度慢的处理方法
- mac git xcrun error active developer path 错误
- Xcode使用教程详细讲解(全)
- Cocos2d开发1:Xcode与TexturePacker的集成
- windows下objective-c的cocoa框架编程,可以有图形界面哟
- Xcode控制台命令
- 【卡片记忆】快速启动iOS模拟器
- OSX下Xcode更新后,Git提示确认证书
- 解决Xcode symbol not found问题
- Xcode5.0.2 资源更新问题
- Xcode7升级到Xcode8之后遇到文件冲突
- Objective-C(1) 认识一下吧
- Objective-C(13)代码块---block