Documentation / 05
Settings and script phases
Declare build settings and Run Script phases alongside the dependencies that need them.
Build settings
target 'Game' do
settings 'OTHER_LDFLAGS' => ['$(inherited)', '-ObjC'],
'DEAD_CODE_STRIPPING' => true
settings 'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => '$(inherited) BETA', configurations: ['Beta']
endBooleans become YES or NO. Array elements are joined with spaces, and elements containing spaces are quoted. Scalar values retain explicit xcconfig quoting and escaping. SwiftPods writes managed target settings to SwiftPods/Settings/<Project>/<Target>.xcconfig. It uses this file as the base configuration when the target has none. Settings stored directly on the target still take precedence.
If a target already has a base configuration file, add the include SwiftPods prints to that file. Its relative path depends on your project layout, for example:
#include? "../SwiftPods/Settings/Game/Game.xcconfig"Script phases
The Podfile is not executed, but its declared build scripts run during your Xcode build. Review scripts and third-party dependencies before building an untrusted project.
target 'Game' do
script_phase name: 'Crashlytics',
script: '"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"',
input_files: ['${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}'],
execution_position: :after_compile
endname and script are required. Options: shell_path, input_files, output_files, input_file_lists, output_file_lists, execution_position (:before_compile, :after_compile or :any), based_on_dependency_analysis and show_env_vars_in_log.
[SwiftPods] Prepare runs :before_compile scripts; [SwiftPods] Finish runs :after_compile and :any scripts after the target's other phases. Both run on every build, in declaration order. File lists must be regular, non-symlink files inside the Podfile directory unless you explicitly pass --allow-external-file-lists. show_env_vars_in_log defaults to false; when enabled, it logs only allowlisted build diagnostics, not the full environment.