Objective-C –具有包含 TestFlight SDK 的 TestFlight 配置

发布于 2024-12-14 02:49:11 字数 260 浏览 0 评论 0原文

我已按照 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

云柯 2024-12-21 02:49:11

您可以很容易地使用 #ifdef 语句排除代码运行,正如我们在此处为我们的 HockeyApp 服务建议的那样:http://support.hockeyapp.net/kb/client-integration/crash-reporting-on-ios-quincykit

基本上是:

  1. 添加预处理器 将预处理器宏添加到您的 Xcode 项目中以用于所有配置:CONFIGURATION_$(CONFIGURATION)

  2. < p>然后您将能够使用这些代码行仅包含特定配置的代码:

    #if 已定义 (CONFIGURATION_Beta)
        // 你的代码
    #endif
    
  3. 这会将 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-quincykit

Basically it is:

  1. Add a preprocessor macro to your Xcode project for all configurations: CONFIGURATION_$(CONFIGURATION)

  2. Then you will be able to use these lines of code to include code only for a specific configuration:

    #if defined (CONFIGURATION_Beta)
        // YOUR CODE
    #endif
    
  3. This replace Beta with the name of your configuration that should include the code only

The 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.

错々过的事 2024-12-21 02:49:11

我认为您必须创建一个单独的构建配置并使用类似 #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.

终遇你 2024-12-21 02:49:11

我的解决方案是在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文