有没有办法使用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.5and 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/
更多推荐
发布评论