SKAdNetwork ID Auto Updater
The iOS SKAdNetwork ID Auto Updater is a build automation tool that keeps your Info.plist file synchronized with the latest SKAdNetwork IDs from your advertising partners during each build process. This ensures the list of supported ad network IDs remains current, even when partners update their IDs.
This article describes how to build, deploy, and integrate the tool into Xcode and Unity Editor.
Installing the Auto Updater
Download the DT SKAd_updater from GitHub. There are several methods to install the tool:
Installing via Homebrew (Preferred)
Add the tap:
brew tap fyber-engineering/skad_updaterInstall the application:
brew install skad_updaterDownloading the Release Tar File
Download a specific release version from SKAd_updater on GitHub
Select the required release version.
Download the
.tar.gzfile and extract to your required folder
tar -xzf skad_updater-.tar.gz -C [folder-name]Run the executable inside the inner
binfolder.(Optional) Add the executable to your
$PATHto useskad_updaterglobally.
Compiling the Source Code
Run all commands from the repository's root directory base folder.
Prerequisites
Ensure the following dependencies are installed:
macOS 10.15 or later
curl
OMake 3.18 or later
Python 3.8 or later
clang-format
Automatic Build
Run this sequence to build the tool automatically:
Manual Build
Build the tool step by step:
Testing the Source Code
Verify the tool works correctly in your environment.
Prerequisites
Ensure the following dependencies are installed:
curl
Python 3.8 or later
Create a virtual env under
tests/servermockand install:
Testing
Verify the tool works correctly in your environment.
Packaging
Generate a .tar.gz file in the build directory.
Utilizing the Tool
Synopsis
Run skad_updater from the terminal to update your Info.plist with the required SKAdNetwork IDs.
Network List Options
Define which networks to update:
Explicit
Use
--show_networksto show a list of supported ad networks.Use
[--network_list <network-name-list>]to show a parameter with a list of network names separated by a comma
Automatic
Use
pod_file_path <pod-file-path>to automatically derive networks from your Podfile, where<pod-file-path>is the path to the pod file.
Combination
Use both
--network_listandpod_file_pathto combine explicit and automatic network lists.
Parameters
The following table describes the network list parameters.
Parameter
Value
Description
plist_file_path
list-file-path
Path to the target Info.plist file.
--network_list
<comma-separated-network-names>
Requests a specific list of networks to update. Provides a comma-separated list of network names as the argument, which you can combine with networks found in the Podfile.
pod_file_path
<pod-file-path>
Update all the networks found in the Podfile.
Provide the Podfile path as the argument. Update additional networks not in the Podfile by including them in the --network_list argument.
Optional Parameters
Parameter
Description
--dry_run
Performs a dry run and prints the updated plist file instead of overwriting.
--show_networks
Shows the list of supported networks.
--help, -h
Provides a help message and exit
Examples
The following examples show how to use skad_updater with different parameters:
Backups
The tool backs up the current Info.plist as Info.plist.back.X whenever it modifies the file. X increments with each backup.
Reformatting the plist File
The Auto Updater formats the plist using standard XML indentation. Xcode may display slightly different formatting. To restore Xcode formatting:
Man Page
Use the manpage to read the usage instructions from the terminal:
Integrating into a Build Environment with Cocoapods
Use the skad_updater tool to automatically update your SKAdNetwork IDs during the build process.
iOS
Manually add a Run Script Phase in Xcode to trigger the skad_updater tool.
Open your Xcode project.
Select the project in the Project Navigator.
Select the Build Phases tab to enable the build phase menu items.
Click Add in the project editor to add build phases.
Select a Run Script phase and add the following shell script:
Build your project.
The skad_updater tool automatically updates your Info.plist file.
Unity
Use Unity's scripting APIs to automatically add a Build Phase that runs the skad_updater tool.
Export the Xcode project from Unity to add a Build Phase to Xcode, which will update the
Info.plistfile.Add the Build Phase automatically and insert a run script using Unity's scripting APIs. The script automatically inserts a Run Script Phase after the Xcode project is generated.
Add a new script file to the
Assets/Editorfolder in your Unity project, as in the following example.
The
skad_updaterautomatically updates yourInfo.plistfile.
Integrating into a Build Environment without Cocoapods
If you do not use CocoaPods, follow the same steps; however, instead of passing <pod_file_path>, use --network_list in the script to provide a comma-separated network list.
Last updated
