[英]Do not Integrate TestFlight SDK in Release Builds using Cocoapods
I integrated the TestFlight SDK
using Cocoapods with the following Podfile
: https://gist.github.com/fabb/8841271 我使用Cocoapods将
TestFlight SDK
与以下Podfile
: https : Podfile
I do not want the TestFlight library to be linked in Release
builds (build config, not target). 我不希望TestFlight库在
Release
版本中链接(构建配置, 而不是目标)。
This article shows a way to remove the libTestFlight.a
file from Release builds using the EXCLUDED_SOURCE_FILE_NAMES
custom build setting. 本文介绍了使用
EXCLUDED_SOURCE_FILE_NAMES
自定义生成设置从发布版本中删除libTestFlight.a
文件的方法。
Is there a way I can do this using Cocoapods too? 有没有办法可以用Cocoapods做到这一点? Remember, Cocoapods does link the
libTestFlight.a
into its libPods.a
, so setting the custom build setting in the app target will not help. 请记住,Cocoapods确实将
libTestFlight.a
链接到其libPods.a
,因此在app目标中设置自定义构建设置将无济于事。
An alternative idea would be to only include the TestFlight SDK
pod for my TestFlightRelease
build config - but it seems this is not yet supported by Cocoapods. 另一个想法是只为我的
TestFlightRelease
构建配置包含TestFlight SDK
pod - 但似乎Cocoapods尚不支持。
There is a suggested workaround while the feature gets implemented: 在实现该功能时,有一个建议的解决方法 :
Create a new (empty) target of type "Static Library" named "DebugTools" in your user project
在用户项目中创建一个名为“DebugTools”的“静态库”类型的新(空)目标
Link it with your application, but only in Debug, by adding
-lDebugTools
to theOTHER_LDFLAGS
Build Setting but only for the Debug configuration (don't forget to keep$(inherited)
if not present already)将它与您的应用程序链接,但仅在Debug中,通过将
-lDebugTools
添加到OTHER_LDFLAGS
构建设置中,但仅用于调试配置(如果不存在则不要忘记保留$(inherited)
)Then you should be able to configure the pods needed in debug by adding them in the DebugTool target only, via your Podfile, like:
然后,您应该能够通过Podfile将它们添加到DebugTool目标中来配置调试中所需的pod,如:
pod 'AFNetworking' # For all build configurations, Debug and Release target 'DebugTools', :exclusive => true do pod 'PonyDebugger' # Debugger only needed in debug pod 'OHHTTPStubs' # Stubs for Network Requests only in debug too end
The implementation status is updated in the same thread. 实现状态在同一个线程中更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.