/

Fastlane Plugin

Integrate Shield iOS directly into your Fastlane pipeline. Protect your app as part of your CI/CD lanes.


Prerequisites

Install the shield-ios CLI on the machine that runs Fastlane:

Bash
pip install bytehide-shield-ios
# or
brew install bytehide/tap/shield-ios

Install the Plugin

Bash
fastlane add_plugin shield_ios

Or add it manually to your Pluginfile:

Ruby
gem "fastlane-plugin-shield_ios"

Then run:

Bash
bundle install

Usage

Basic Example

Ruby
platform :ios do
  lane :release do
    build_app(
      scheme: "MyApp",
      archive_path: "build/MyApp.xcarchive",
      skip_package_ipa: true
    )

    shield_ios(
      archive_path: "build/MyApp.xcarchive",
      config: "shield-ios.json"
    )

    build_app(
      archive_path: "build/MyApp.xcarchive",
      skip_build_archive: true
    )

    upload_to_app_store
  end
end

The flow is:

  1. build_app — Compiles and creates the .xcarchive (skip IPA packaging)
  2. shield_ios — Applies protections to the archive
  3. build_app — Packages the protected archive into an IPA (Xcode handles signing)
  4. upload_to_app_store — Uploads to App Store Connect

Protect an IPA Directly

Ruby
shield_ios(
  archive_path: "build/MyApp.ipa",
  config: "shield-ios.json"
)

Custom Output Path

Ruby
shield_ios(
  archive_path: "build/MyApp.xcarchive",
  output_path: "build/MyApp-protected.xcarchive",
  config: "shield-ios.json",
  no_sign: false,
  verbose: true
)

Parameters

ParameterTypeRequiredDefaultDescription
archive_pathStringYesPath to the .xcarchive or .ipa
output_pathStringNoSame as inputOutput path for the protected archive
configStringNonilPath to shield-ios.json configuration file
no_signBooleanNotrueSkip code signing after protection
verboseBooleanNofalseEnable verbose output

Environment Variables

All parameters can be set via environment variables, useful for CI/CD:

VariableParameter
SHIELD_IOS_ARCHIVE_PATHarchive_path
SHIELD_IOS_OUTPUT_PATHoutput_path
SHIELD_IOS_CONFIGconfig
SHIELD_IOS_NO_SIGNno_sign
SHIELD_IOS_VERBOSEverbose

Example with env vars:

Bash
export SHIELD_IOS_ARCHIVE_PATH="build/MyApp.xcarchive"
export SHIELD_IOS_CONFIG="shield-ios.json"
Ruby
# Fastfile — no arguments needed
shield_ios

CI/CD Examples

GitHub Actions

YAML
- name: Install Shield iOS
  run: pip install bytehide-shield-ios

- name: Build and Protect
  run: |
    bundle exec fastlane release

GitLab CI

YAML
release:
  stage: deploy
  script:
    - pip install bytehide-shield-ios
    - bundle exec fastlane release

Jenkins

Groovy
stage('Release') {
    steps {
        sh 'pip install bytehide-shield-ios'
        sh 'bundle exec fastlane release'
    }
}

Troubleshooting

"shield-ios CLI not found"

The plugin requires the shield-ios CLI to be installed on the system. Install it with:

Bash
pip install bytehide-shield-ios

Make sure it's in the PATH of the user running Fastlane.

"archive_path must be an .xcarchive or .ipa file"

The archive_path must point to a file with .xcarchive or .ipa extension.

"Archive not found at path"

The file doesn't exist at the specified path. Make sure build_app ran successfully and the path matches.


Next Steps

CLI Reference

Full CLI reference and protection options

Xcode Integration

Manual Xcode setup with post-archive actions

CI/CD Integration

GitHub Actions, GitLab CI, and more

Previous
Homebrew