Objective-C –具有包含 TestFlight SDK 的 TestFlight 配置
我已按照 TestFlight 的说明复制“发布”配置。我还使用 TestFlight SDK 从我的应用程序获取实时报告。通过这样做,我必须在我的应用程序中包含一些 TestFlight 代码。当然,我不想在我的应用程序的发布版本中包含此代码。
有没有办法只在 testflight 配置(重复的发布配置)中包含此代码?您可以使用 #ifdef DEBUG
进行调试配置(或者我是否必须为此创建一个单独的目标并且仅在该目标中包含 TestFlight SDK?)
I've followed the instructions from TestFlight to duplicate the "release" configuration. Also I'm using TestFlight SDK to get live reports from my app. By doing this I had to include some TestFlight code in my application. Of course I don't want to have this code in my release version of my app.
Is there some way to only include this code in the testflight configuration (the duplicated release configuration)? The same way you can do with #ifdef DEBUG
for the debug configuration (or do I have to create a separate target for this and only include the TestFlight SDK in that target?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以很容易地使用
#ifdef
语句排除代码运行,正如我们在此处为我们的 HockeyApp 服务建议的那样:http://support.hockeyapp.net/kb/client-integration/crash-reporting-on-ios-quincykit基本上是:
添加预处理器 将预处理器宏添加到您的 Xcode 项目中以用于所有配置:
CONFIGURATION_$(CONFIGURATION)
这会将
Beta
替换为应包含的配置名称仅代码上面的链接提供了有关如何执行此操作的图像和更详细的文本。由于您将仅在 Beta 发行版配置中使用该库,因此除了已为 Beta 发行版创建的配置之外,您无需创建其他配置。
您需要有一种用于调试的配置,用于开发,一种用于测试版分发以设置临时权利,另一种用于应用程序商店分发。最后两个通常是发布配置的变体。
You can exclude code from running using
#ifdef
statements pretty easily, as we suggest it for our HockeyApp service here: http://support.hockeyapp.net/kb/client-integration/crash-reporting-on-ios-quincykitBasically it is:
Add a preprocessor macro to your Xcode project for all configurations:
CONFIGURATION_$(CONFIGURATION)
Then you will be able to use these lines of code to include code only for a specific configuration:
This replace
Beta
with the name of your configuration that should include the code onlyThe link above provides images and more detailed text on how to do it. Since you will use that library only in your beta distribution configuration, you don't need to create another configuration besides the already created one for beta distribution.
You need to have one configuration for debug, which is for development, one for beta distribution to set the adhoc entitlements and one for app store distribution. The last two are usually variations of the release configuration.
我认为您必须创建一个单独的构建配置并使用类似
#ifdef TESTFLIGHT
的内容。您应该为该配置添加一个宏,以便它仅为 TestFlight 配置定义。I think you'd have to create a separate build configuration and use something like
#ifdef TESTFLIGHT
. You should add a macro for that configuration so it's defined only for the TestFlight configuration.我的解决方案是在 Git 中为 Testflight 版本建立一个单独的分支,其中包括 SDK 以及代码、标头等中的调用。
然后,我在主分支上完成所有工作,并使 Testflight 分支与这些分支保持最新状态变化。这样我就不必包含我在发布版本中不使用的库或标头。
这比听起来简单。
My solution to this is to have a separate branch in Git for the Testflight version which includes the SDK and calls in the code, headers, etc.
I then do all my work on the main branch and keep the Testflight branch up to date with these changes. That way I don't have to include libraries or headers that I don't use in my shipping version.
It's simpler than it sounds.