来自{PRODUCT_NAME}的XCode包标识符格式 [英] XCode bundle identifier formatting from {PRODUCT_NAME}

查看:167
本文介绍了来自{PRODUCT_NAME}的XCode包标识符格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在XCode构建设置中有一个iPhone应用程序,其产品名称为我的应用程序(单词之间有空格)。在我的 info.plist 中,Bundle标识符指定为<​​code> com.mycompany。$ {PRODUCT_NAME:rfc1034identifier}

Assume I have an iPhone application whose Product Name is "My App" (with a space between words) in XCode build settings. In my info.plist, the Bundle identifier is specified as com.mycompany.${PRODUCT_NAME:rfc1034identifier}

在应用程序包中生成的 info.plist 中,包标识符显示为 com.mycompany.My-App 。我需要它是 com.mycompany.MyApp 。如何更改Bundle Identifier设置,以便按照我想要的方式转换产品名称?

In the resulting info.plist in the application bundle, the bundle identifier is shown as com.mycompany.My-App. I need it to be com.mycompany.MyApp. How do I change the Bundle Identifier setting so it would convert the product name the way I want?

ps。
如果我将 $ {PRODUCT_NAME:rfc1034identifier} 更改为 $ {PRODUCT_NAME:identifier} ,则会产生包标识符将是 com.mycompany.My_App 。我只需要在结果中完全删除产品名称中的空格字符。

ps. If I change the ${PRODUCT_NAME:rfc1034identifier} to ${PRODUCT_NAME:identifier}, the resulting bundle identifier will be com.mycompany.My_App. I just need to remove the space character in the product name completely in the result.

推荐答案

只需输入?

ie而不是 com.mycompany。$ {PRODUCT_NAME:rfc1034identifier} 只需输入 com.mycompany.MyApp

i.e. instead of com.mycompany.${PRODUCT_NAME:rfc1034identifier} just type com.mycompany.MyApp

如果您有多个目标需要不同的包名称,一种方法是创建自己的变量并使用它。

If you have more than one target that need different bundle names, one way of doing it is to create your own variable and use that instead.

在构建菜单(选择项目并选择获取信息)中,您可以将自己的变量添加到项目中。如果您创建一个名为MY_BUNDLE_NAME并将其设置为MyApp,则可以在plist文件中放入 com.mycompany。$ {MY_BUNDLE_NAME} 。您应该可以将MY_BUNDLE_NAME设置为不同目标的不同值。

In the build menu (select your project and choose Get Info), you can add your own variables to the project. If you make one called MY_BUNDLE_NAME and set it to MyApp, you can then put com.mycompany.${MY_BUNDLE_NAME} in the plist file. You should be able to set MY_BUNDLE_NAME to different values for different targets.

这篇关于来自{PRODUCT_NAME}的XCode包标识符格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆