有没有办法在我的应用程序的调试版本中仅包含设置捆绑包? [英] Is there a way to have a settings bundle ONLY in the debug version of my app?

查看:129
本文介绍了有没有办法在我的应用程序的调试版本中仅包含设置捆绑包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于生产环境,我应用程序的所有用户都将指向生产URL,但对于开发人员,我们有多个开发人员,我想创建一个设置包,以便其他开发人员可以轻松地将其ios设备重新配置为指向自己的计算机.有没有办法只在应用程序的调试(又称非生产性)版本中包含设置包?

For production all users of my app will point at the production URL but for dev we have multiple developers and I want to create a settings bundle so the other devs can easily reconfigure their ios devices to point at their own machines. Is there a way to only have the settings bundle in the debug (aka non production) version of the app?

推荐答案

我为NSUserDefaults编写了一个包装器.在我的应用程序委托中,我检查编译器标志,以查看我们是否处于发布或调试模式,并将默认设置为测试与生产环境.然后,我在登录视图控制器中使用那些相同的编译器标志来显示/隐藏一个按钮,该按钮允许我们的测试用户从通过构建中包含的plist提供的不同环境中进行选择.

I wrote a wrapper for the NSUserDefaults. In my app delegate I check compiler flags to see if we are in release or debug mode and set the default to the testing vs production environments. Then I use those same compiler flags in my logon view controllers to display/hide a button that allows our test users to select from the different enviroments that are provided via a plist I've included in the build.

答案是-编译器标志设置默认值,调试启用的界面提示设置开发人员特定的值.

So the answer is - Compiler Flags to set the default values, and debug enabled interface prompts to set developer specific values.

这篇关于有没有办法在我的应用程序的调试版本中仅包含设置捆绑包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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