/

iOS CI/CD Integration

Integrate ByteHide Monitor into your iOS CI/CD pipeline so every build is protected automatically.


Overview

Monitor requires the BYTEHIDE_TOKEN environment variable to be available at build time. The build-time script validates the token and embeds the configuration into the app bundle, enabling Monitor to auto-initialize at runtime.


GitHub Actions

YAML
name: Build iOS App

on:
  push:
    branches: [main]

jobs:
  build:
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install CocoaPods
        run: |
          gem install cocoapods
          pod install

      - name: Build IPA
        env:
          BYTEHIDE_TOKEN: ${{ secrets.BYTEHIDE_TOKEN }}
        run: |
          xcodebuild archive \
            -workspace YourApp.xcworkspace \
            -scheme YourApp \
            -configuration Release \
            -archivePath YourApp.xcarchive

          xcodebuild -exportArchive \
            -archivePath YourApp.xcarchive \
            -exportPath . \
            -exportOptionsPlist ExportOptions.plist

      - name: Upload IPA
        uses: actions/upload-artifact@v4
        with:
          name: app-protected
          path: YourApp.ipa

Store your token securely

Add BYTEHIDE_TOKEN as a repository secret in GitHub: Settings > Secrets and variables > Actions > New repository secret.


GitLab CI

YAML
build_ios:
  stage: build
  tags:
    - macos
  variables:
    BYTEHIDE_TOKEN: $BYTEHIDE_TOKEN
  script:
    - pod install
    - xcodebuild archive
        -workspace YourApp.xcworkspace
        -scheme YourApp
        -configuration Release
        -archivePath YourApp.xcarchive
    - xcodebuild -exportArchive
        -archivePath YourApp.xcarchive
        -exportPath .
        -exportOptionsPlist ExportOptions.plist
  artifacts:
    paths:
      - YourApp.ipa

Add BYTEHIDE_TOKEN as a CI/CD variable in Settings > CI/CD > Variables.


Azure DevOps

YAML
trigger:
  - main

pool:
  vmImage: 'macos-latest'

steps:
  - script: |
      gem install cocoapods
      pod install
    displayName: 'Install CocoaPods'

  - script: |
      xcodebuild archive \
        -workspace YourApp.xcworkspace \
        -scheme YourApp \
        -configuration Release \
        -archivePath YourApp.xcarchive
    env:
      BYTEHIDE_TOKEN: $(BYTEHIDE_TOKEN)
    displayName: 'Build with Monitor'

Key Points

  • The BYTEHIDE_TOKEN must be available as an environment variable during the Xcode build
  • The token is validated and embedded at build time; no runtime environment variable is needed on the device
  • Store the token as a secret in your CI/CD platform. Never commit it to source control
  • Use macos runners for iOS builds (required for Xcode)
Previous
CocoaPods / SPM