简体   繁体   English

Xcode - 如何使它对相同的代码库、不同的目标使用不同的 plist 文件

[英]Xcode - How to make it use different plist file for same code base, different targets

I have a code base that I need to build out to two different targets.我有一个代码库,需要针对两个不同的目标进行构建。 The only difference is they read different config.plists, config-1.plist for target #1 and config-2.plist for target #2.唯一的区别是它们读取不同的 config.plist,目标 #1 的 config-1.plist 和目标 #2 的 config-2.plist。 What do I need to do in the building to achieve this?我需要在建筑物中做什么才能实现这一目标?

Like this:像这样:

  • Select your project from the navigator to the left从左侧的导航器中选择您的项目
  • Select the target you want to change (under TARGETS)选择要更改的目标(在 TARGETS 下)
  • Click "Build Settings"点击“构建设置”
  • Search for "Info.plist"搜索“Info.plist”

In the Packaging section, you should see a setting called Info.plist file .在 Packaging 部分,您应该看到一个名为Info.plist file的设置。

  • Change that to you "config-2.plist" or whatever you want.将其更改为“config-2.plist”或您想要的任何内容。

You also need to create the two plist-files of course.当然,您还需要创建两个 plist 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM