开发者

Xcode 4 overriding Summary and Info values in Target Settings

I have made two targets in my project. One for a Staging version and one for a Release version. This way I control the different setting that goes into each build. (different version, different identifier, different URL schemes etc.)

Everything in the (with the appropriate target selected) "Build Settings" tab behaves nicely and does not change. The things in the "Summary" and "Info" tabs, however does not persist between building/running the app.

If I go to the Staging Target and enter a version number, then to the Release Target and enter a different number everything is fine at first. When I Run the project, however, the values gets "synchronize开发者_高级运维d". So if I run the Scheme that uses the Release Target it will set Release Target values on the Staging and vice versa.

In my understanding the targets inherits their values from the Project Settings, but I am pretty sure they should not inherit from each other, which would defy the point of targets.

Is there somewhere I have linked the two or ticked a wrong checkbox?

Thanks for any help given.


The problem turned out to be that the apps app-info.plist file took precedense over the target settings. This meant that settings/values that were in both the target setting and the app-info.plist file would end up selecting the app-info.plist values at compile time.

The solution is to make an individual info.plist file for each target. I now have app-info-staging.plist and app-info-release.plist - each with the values specific for the target. Doing it like this makes the target plist file take precedense over the app-info.plist file.


You should check the Build Configuration of the different stages of you Build in the Schemes you are using. Maybe they aren't set correctly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜