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
Option 1: CocoaPods (Recommended)
CocoaPods is the recommended installation method. It automatically configures build-time validation scripts.
Step 1: Add to Podfile
platform :ios, '12.0'
target 'YourApp' do
use_frameworks!
pod 'ByteHideMonitor', '~> 1.0.0'
endplatform :ios, '12.0'
target 'YourApp' do
use_frameworks!
pod 'ByteHideMonitor', '~> 1.0.0'
endStep 2: Install
pod installpod installThat'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
- In Xcode, go to File > Add Package Dependencies...
- Enter the repository URL:
https://github.com/bytehide/bytehide-monitor - Set the version rule to 1.0.0 or later
- Select your app target and click Add Package
Step 2: Run Setup Script (One Time Only)
# Install xcodeproj gem (if not already installed)
gem install xcodeproj
# Run setup from your project directory
cd YourProject
ruby Packages/ByteHideMonitor/setup-spm.rb# Install xcodeproj gem (if not already installed)
gem install xcodeproj
# Run setup from your project directory
cd YourProject
ruby Packages/ByteHideMonitor/setup-spm.rbThis 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:
xcodebuild -workspace YourApp.xcworkspace -scheme YourApp -configuration Debug buildxcodebuild -workspace YourApp.xcworkspace -scheme YourApp -configuration Debug buildYou 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.