XCode:我可以用xcconfig中的值覆盖CFBundleVersion吗?(XCode: can I overwrite CFBundleVersion with value in xcconf

编程入门 行业动态 更新时间:2024-10-17 21:17:33
XCode:我可以用xcconfig中的值覆盖CFBundleVersion吗?(XCode: can I overwrite CFBundleVersion with value in xcconfig?)

有没有办法使用xcconfig中定义的值来覆盖项目设置中的值,如CFBundleVersion ? 我试图添加一个键值说:

MyVersion = 1.5

并将其设置为信息plist作为Bundle版本的${MyVersion} ,但它不起作用。

谢谢!

Is there a way to use value defined in xcconfig to overwrite the value in project settings like CFBundleVersion? I tried to add a key-value say:

MyVersion = 1.5

and set it in Info plist as ${MyVersion} for Bundle version, but it doesn't work.

Thanks!

最满意答案

xcconfig文件变量的引用不带括号或paren,如下所示: $MyVersion 。

您还需要将xcconfig分配给项目设置中的配置。 在左侧窗格中单击项目,然后在中间窗格中单击您的项目,然后找到配置部分,然后展开每个配置(调试,发布等),并使用每个目标的下拉列表分配xcconfig。

完整的教程在这里: https : //burcugeneci.wordpress.com/2015/09/24/using-xcconfig-files-and-custom-schemes-for-your-xcode-project/

xcconfig file variables are referenced without brackets or paren, like this: $MyVersion.

You also need to assign the xcconfig to the configurations in the project settings. Click project in the left pane, then click your project in the middle pane, then find the configurations section, then expand each configuration (debug, release, etc.) and assign the xcconfig using the dropdown for each target.

Full tutorial here: https://burcugeneci.wordpress.com/2015/09/24/using-xcconfig-files-and-custom-schemes-for-your-xcode-project/

更多推荐

本文发布于:2023-07-16 13:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128939.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以用   XCode   xcconfig   overwrite   CFBundleVersion

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!