FLEX is a debugging tool and should not be included in production App Store builds. Depending on your integration method, use the following strategies to ensure FLEX is only present in Debug builds.
General Code Practice
Wrap all code where you integrate FLEX with an #if DEBUG statement to prevent errors in Release builds and ensure the tool is inaccessible to users.
CocoaPods
Specify the Debug configuration for the FLEX pod in your Podfile:
pod 'FLEX', :configurations => ['Debug']
Carthage
- Do NOT add
FLEX.framework to your target's embedded binaries. - Add
$(PROJECT_DIR)/Carthage/Build/iOS to your target's Framework Search Paths. - Add a Run Script Phase (after
Link Binary with Libraries) to embed the framework only during debug builds:
if [ "$CONFIGURATION" == "Debug" ]; then
/usr/local/bin/carthage copy-frameworks
fi
Ensure $(SRCROOT)/Carthage/Build/iOS/FLEX.framework is added as an input file to this script phase.
Swift Package Manager
In Xcode, navigate to Build Settings > Build Options > Excluded Source File Names. For your Release configuration, set the value to FLEX* to exclude all files starting with the FLEX prefix.