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_updaterarrow-up-right from GitHub. There are several methods to install the tool:

Installing via Homebrew (Preferred)

  1. Add the tap:

Bash
brew tap fyber-engineering/skad_updater
  1. Install the application:

Bash
brew install skad_updater

Downloading the Release Tar File

Download a specific release version from SKAd_updaterarrow-up-right on GitHub

  1. Select the required release version.

  2. Download the .tar.gz file and extract to your required folder

Bash
tar -xzf skad_updater-.tar.gz -C [folder-name]
  1. Run the executable inside the inner bin folder.

  2. (Optional) Add the executable to your $PATH to use skad_updater globally.

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:

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_networks to 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_list and pod_file_path to 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.

  1. Open your Xcode project.

  2. Select the project in the Project Navigator.

  3. Select the Build Phases tab to enable the build phase menu items.

  4. Click Add in the project editor to add build phases.

  5. Select a Run Script phase and add the following shell script:

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

  1. Export the Xcode project from Unity to add a Build Phase to Xcode, which will update the Info.plist file.

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

  3. Add a new script file to the Assets/Editor folder in your Unity project, as in the following example.

  1. The skad_updater automatically updates your Info.plist file.

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