/

iOS Installation - CocoaPods & SPM

Install ByteHide Monitor in your iOS project using CocoaPods or Swift Package Manager.


Requirements

  • Xcode 14 or later
  • iOS Deployment Target: 12.0+
  • Languages: Swift 5.5+ or Objective-C
  • Dependency Manager: CocoaPods 1.11+ or Swift Package Manager

CocoaPods is the recommended installation method. It automatically configures build-time validation scripts.

Step 1: Add to Podfile

Ruby
platform :ios, '12.0'

target 'YourApp' do
  use_frameworks!
  pod 'ByteHideMonitor', '~> 1.0.0'
end

Step 2: Install

Bash
pod install

That's it! Build-time validation runs automatically on every build.


Option 2: Swift Package Manager

SPM requires a one-time setup step to configure the build script.

Step 1: Add the Package

  1. In Xcode, go to File > Add Package Dependencies...
  2. Enter the repository URL: https://github.com/bytehide/bytehide-monitor
  3. Set the version rule to 1.0.0 or later
  4. Select your app target and click Add Package

Step 2: Run Setup Script (One Time Only)

Bash
# Install xcodeproj gem (if not already installed)
gem install xcodeproj

# Run setup from your project directory
cd YourProject
ruby Packages/ByteHideMonitor/setup-spm.rb

This script adds the necessary build phases to your Xcode project for build-time token validation.

After this one-time setup, builds work automatically, same as CocoaPods.


Verifying Installation

After installing, build your project to verify the integration:

Bash
xcodebuild -workspace YourApp.xcworkspace -scheme YourApp -configuration Debug build

You should see Monitor's build-time validation in the build output. If the BYTEHIDE_TOKEN environment variable is not set, you'll see a warning. This is expected until you configure your token.


Next Steps

Previous
Quick Start