/

Build Profiles

Build profiles let you apply different protection configurations depending on your build environment. Use lighter protections during development for faster builds, and full protections for production releases.


Skipping Debug Builds

The most common configuration is to skip protection entirely during development. Enable skip_debug in your configuration to automatically skip protection when building for Debug:

JSON
{
  "projectToken": "your-project-token",
  "build_integration": {
    "skip_debug": true,
    "skip_simulator": true
  },
  "protections": {
    "symbol_renaming": true,
    "string_encryption": true,
    "anti_debug": true
  }
}

With this configuration, Shield only runs when you build for Release or any non-Debug configuration.


Multiple Configuration Files

For more control, create separate configuration files for each environment:

CODE
MyApp/
├── shield-ios.json            ← Production (full protections)
├── shield-ios-staging.json    ← Staging (moderate protections)
└── shield-ios-dev.json        ← Development (minimal protections)

Production (shield-ios.json):

JSON
{
  "projectToken": "your-project-token",
  "protections": {
    "symbol_renaming": true,
    "string_encryption": true,
    "control_flow": "aggressive",
    "dead_code_injection": "heavy",
    "opaque_predicates": "complex",
    "anti_debug": true,
    "anti_jailbreak": true,
    "rasp": true,
    "class_encryption": true,
    "resource_encryption": true
  }
}

Staging (shield-ios-staging.json):

JSON
{
  "projectToken": "your-project-token",
  "protections": {
    "symbol_renaming": true,
    "string_encryption": true,
    "control_flow": "light",
    "anti_debug": true
  }
}

Select the configuration file at build time:

Bash
shield-ios protect MyApp.ipa -c shield-ios-staging.json -o MyApp_staging.ipa

Xcode Build Phase with Profiles

You can select the configuration file based on the Xcode build configuration:

Bash
# Shield iOS Protection
if [ "${CONFIGURATION}" == "Release" ]; then
    CONFIG_FILE="${PROJECT_DIR}/shield-ios.json"
elif [ "${CONFIGURATION}" == "Staging" ]; then
    CONFIG_FILE="${PROJECT_DIR}/shield-ios-staging.json"
else
    exit 0  # Skip for Debug
fi

shield-ios protect "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app" \
    -c "$CONFIG_FILE" \
    -o "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app"

Previous
Configuration Reference