Xcode的Product Name、Bundle Name、Bundle Display Name区别

来源:互联网 发布:炒股软件接口 编辑:程序博客网 时间:2024/04/30 12:32
  • 通常我们在 info.plist 中,可以看到类似如下配置:

    • Bundle Display Name - ${PRODUCT_NAME}

    • Executable File - ${EXECUTABLE_NAME}

    • Bundle Name - ${PRODUCT_NAME}

相关说明:

Bundle name – is folder name, where your app (including executable file and all resources) will be stored (Cool Program.app). Executable name – is a program binary name, i.e. Cool Program.app/CoolProgram Bundle display name – is what will be shown on iPhone screen, for example Cool Prog (since Cool Program probably will not fit on Springboard). And, Apple claims, that Bundle Display name must correspond to Bundle name, i.e. you cannot use bundle name TheApplication, and bundle display name Something Other

  • Bundle name 简单来说就是 App 安装到 iOS 机子里的 App 文件夹名。

  • Executable name – 执行程序名,默认与 PRODUCT_NAME 一致。

  • Bundle display name – 真正显示到用户屏幕上的 App 名称。

可见在模拟器/真机上显示的名字是由Bundle Display Name决定的。默认情况下Bundle Display Name就等同于Product Name,所以就造成了我认为Product Name就是应用显示名的错觉。

另外发现,在部分情况下如果Product Name为中文字符,会导致编译运行在真机时,第一次必报 Could not inspect the application package. 错误,这个可以参考《使用 Xcode6 在 iOS8 设备上调试报错 Could not inspect the application package》。

估计我看的这份代码就是遇到了这种情况,将Product Name设置成为了英文名,而将Bundle Display Name设置为中文名。

参考:

  • 使用 Xcode6 在 iOS8 设备上调试报错 Could not inspect the application package

  • Bundle Name, Executable Name, Product Name…anything else?

文章参转自:

  • yoyoso
0 0