Enterprise-grade iOS TestFlight automation platform with intelligent certificate management
Deploy iOS apps to TestFlight in under 1 minute with complete automation from certificates to processing verification
✅ v2.13.0 STATUS: PRODUCTION READY - Enterprise-grade iOS automation platform with privacy validation, automatic TestFlight conflict resolution and bulletproof certificate management.
Most iOS automation tools fail at scale. This platform solves the real problems teams face:
- 🕐 4+ hours per deployment with manual TestFlight uploads
- 💥 Certificate hell - only works on one developer's machine
⚠️ Version conflicts cause constant deployment failures- 🔧 xcrun altool failures due to API key location issues
- 👥 Team collaboration impossible - new developers take days to set up
- ⚡ 1-minute deployments with complete end-to-end automation
- 🎯 100% TestFlight success rate with verified xcrun altool integration
- 🛡️ Enhanced CI/CD compatibility - seamless integration with all automation platforms
- 🚀 Enhanced TestFlight confirmation - wait for Apple processing with real-time status
- 📊 Advanced logging & audit trails - comprehensive upload tracking
- 🔄 Smart provisioning profile reuse - no more unnecessary profile creation
- 🤝 5-minute team onboarding - any developer can deploy instantly
- 🏢 Multi-team support - complete isolation between Apple Developer teams
- 🧠 Smart TestFlight version checking prevents upload conflicts
- 🔐 Temporary keychain security - complete isolation from system keychain
- 🏗️ Clean Architecture Foundation - domain-driven design with 95%+ test coverage
- 🔄 Monolithic Stability - proven reliability with comprehensive business logic
- 🎯 Apple API Integration - clean abstraction layer for all Apple services
PROBLEM SOLVED: Prevent TestFlight upload failures due to missing privacy purpose strings (ITMS-90683)
BREAKTHROUGH FEATURES:
- ✅ Pre-Upload Privacy Validation - Catch ITMS-90683 errors before TestFlight upload
- ✅ 15+ Privacy Usage Keys - Comprehensive validation for all iOS privacy APIs
- ✅ Clean Architecture Implementation - Domain-driven design with 95%+ test coverage
- ✅ Smart Info.plist Detection - Automatic project file discovery and validation
- ✅ Three Validation Modes - strict (fail), warn (continue), skip (bypass)
- ✅ Unified Validation System -
apple-deploy validatewith scope support for targeted checking - ✅ Educational Error Messages - Step-by-step fix instructions with Apple documentation links
- ✅ Quality Analysis - Detects placeholder text and insufficient purpose string descriptions
PRIVACY KEYS VALIDATED:
- Media Access: Camera, Microphone, Photo Library, Music Library
- Location Services: When-in-Use, Always, Background tracking
- Personal Data: Contacts, Calendars, Reminders
- Device Capabilities: Speech Recognition, Face ID, Motion Data, Bluetooth
- Health & Fitness: HealthKit read/write permissions
- Network & Tracking: Local Network, User Tracking Transparency
INTEGRATION METHODS:
# 1. Automatic (default) - integrated into deployment pipeline
apple-deploy deploy privacy_validation="strict" [...]
# 2. Standalone validation
apple-deploy validate scope="privacy" scheme="MyApp"
# 3. Custom modes
apple-deploy deploy privacy_validation="warn" [...] # Continue with warnings
apple-deploy deploy privacy_validation="skip" [...] # Bypass validationERROR PREVENTION:
- 🚨 ITMS-90683: Missing purpose string in Info.plist
- 🚨 ITMS-90672: App references privacy-sensitive APIs
- 🚨 App Store Review: Privacy-related rejection patterns
- 🚨 TestFlight Processing: Upload failures due to privacy compliance
How to Upgrade:
brew upgrade apple-deployPROBLEM SOLVED: Fastfile displays incorrect version numbers (1.0.0, build 1) instead of actual project values
FIXED ISSUES:
- ✅ Enhanced project file detection - robust multi-strategy search for .xcodeproj files
- ✅ Improved version parsing - better regex patterns for MARKETING_VERSION and CURRENT_PROJECT_VERSION
- ✅ Working directory diagnostics - detailed logging shows exactly where files are searched
- ✅ Robust error handling - graceful fallback with comprehensive error reporting
TECHNICAL DETAILS:
- Root Cause: Project file detection failed in Homebrew environment due to working directory assumptions
- Solution: Multi-strategy detection (scheme-based → glob pattern → direct file) with detailed logging
- Result: Fastfile now correctly displays the same version numbers as the actual IPA build
How to Upgrade:
brew upgrade apple-deployPROBLEM SOLVED: Fastfile couldn't find project files with different naming patterns, causing version fallback to defaults
FIXED ISSUES:
- ✅ Enhanced project file detection - tries multiple file path patterns automatically
- ✅ Robust glob pattern matching - finds .xcodeproj files regardless of name
- ✅ Better error diagnostics - shows exactly which paths were tried when file not found
- ✅ Universal compatibility - works with any iOS project structure and naming convention
TECHNICAL DETAILS:
- Root Cause: Fastfile assumed specific project file naming (./scheme.xcodeproj/project.pbxproj)
- Solution: Multi-pattern search including glob patterns for .xcodeproj detection
- Result: Automatic version reading works regardless of project file location or name
How to Upgrade:
brew upgrade apple-deployPROBLEM SOLVED: Deploy.sh updates versions correctly but Fastfile uses wrong version numbers, causing upload conflicts
FIXED ISSUES:
- ✅ Version sync between deploy.sh and Fastfile - both now read from same Xcode project source
- ✅ Eliminates "build already exists" false positives - conflict resolution now uses correct version numbers
- ✅ Proper project file integration - Fastfile reads MARKETING_VERSION and CURRENT_PROJECT_VERSION directly
- ✅ Enhanced logging - shows exactly which version numbers are being used for upload
TECHNICAL DETAILS:
- Root Cause: Fastfile was using hardcoded fallback values (1.0.0, build 1) instead of reading updated project values
- Solution: Direct project.pbxproj parsing in Fastfile to match deploy.sh behavior
- Result: 100% version consistency between conflict detection and actual upload
How to Upgrade:
brew upgrade apple-deployPROBLEM SOLVED: "Build number already exists" errors causing deployment failures
NEW FEATURES:
- ✅ Intelligent build conflict detection - automatically queries TestFlight for existing builds
- ✅ Zero-config resolution - automatically increments build numbers when conflicts exist
- ✅ Integrated with all version strategies - patch, minor, and major all include conflict resolution
- ✅ Prevents upload failures - eliminates "build already exists" errors completely
- ✅ Smart retry logic - tries up to 10 different build numbers automatically
UPGRADE BENEFITS:
- 🚀 100% success rate - no more deployment failures due to build conflicts
- ⚡ Zero manual intervention - system handles conflicts automatically
- 🧠 Intelligent querying - real-time TestFlight integration via xcrun altool
- 🛡️ Simplified workflow - removed confusing sync/auto options, conflict resolution built into patch/minor/major
How to Upgrade:
brew upgrade apple-deploy💡 Technical Details: The system uses
xcrun altool --list-buildsto query existing TestFlight builds and automatically increments build numbers when conflicts are detected. See Technical Implementation for details.
PROBLEM SOLVED: "Invalid trust settings. Restore system default trust settings for certificate" errors in CI/CD environments
NEW FEATURES:
- ✅ Automatic certificate trust configuration - works silently in the background
- ✅ Universal CI/CD compatibility - seamless integration with Jenkins, GitHub Actions, GitLab CI, etc.
- ✅ Zero configuration required - fix applies automatically to all projects and teams
- ✅ Enhanced keychain security - bulletproof cleanup and emergency fallback handling
- ✅ Non-interactive operation - perfect for automated deployment pipelines
UPGRADE BENEFITS:
- 🚀 Eliminates build failures from certificate trust issues
- 🛡️ Works across all certificate types - Development, Distribution, Enterprise
- ⚡ Faster deployments - no more manual certificate troubleshooting
- 🤝 Team collaboration - consistent behavior across all developer machines
How to Upgrade:
brew upgrade apple-deploy💡 Technical Details: The fix uses
security set-key-partition-listto grant certificate trust permissions automatically during keychain setup. See Technical Implementation Notes for implementation details.
# Install via Homebrew (recommended)
brew tap snooky23/tools
brew install apple-deploy
# To upgrade to latest version with privacy validation:
brew upgrade apple-deploy🔒 NEW in v2.13.0: MAJOR FEATURE - Privacy validation prevents TestFlight upload failures! See What's New for details.
- Visit App Store Connect API Keys
- Create API key with App Manager role
- Download the
AuthKey_XXXXX.p8file - Note your Key ID and Issuer ID
# Navigate to your iOS project directory
cd /path/to/your-ios-app
# Initialize project structure
apple-deploy init
# Place your API key (will be auto-detected)
mv ~/Downloads/AuthKey_XXXXX.p8 apple_info/
# 🚀 Deploy to TestFlight
apple-deploy deploy \
apple_info_dir="./apple_info" \
team_id="YOUR_TEAM_ID" \
app_identifier="com.yourcompany.app" \
apple_id="your@email.com" \
api_key_id="YOUR_KEY_ID" \
api_issuer_id="your-issuer-uuid" \
app_name="Your App" \
scheme="YourScheme"# Add the tap and install
brew tap snooky23/tools
brew install apple-deploy
# Verify installation
apple-deploy version# Clone repository
git clone https://github.com/snooky23/apple-deploy.git
cd apple-deploy
# Install Ruby dependencies
bundle install
# Ready to use from any iOS project directory| Command | Purpose |
|---|---|
apple-deploy deploy |
Complete TestFlight deployment with privacy validation |
apple-deploy validate |
Unified validation system with flexible scope targeting |
apple-deploy status |
Check TestFlight build status and environment health |
apple-deploy verify_build |
Standalone IPA verification and integrity checks |
apple-deploy init |
Initialize project structure |
apple-deploy setup_certificates |
Setup certificates & profiles |
apple-deploy help |
Show usage information |
apple-deploy version |
Show version information |
What it does: Full end-to-end deployment from code to TestFlight
- ✅ NEW: Validates privacy usage descriptions (prevents ITMS-90683)
- ✅ Creates/imports certificates automatically
- ✅ Builds your iOS app with proper signing
- ✅ Uploads to TestFlight with version management
- ✅ Monitors processing until "Ready to Test"
apple-deploy deploy \
apple_info_dir="./apple_info" \
team_id="ABC1234567" \
app_identifier="com.mycompany.myapp" \
apple_id="developer@mycompany.com" \
api_key_id="ABCD123456" \
api_issuer_id="12345678-1234-1234-1234-123456789012" \
app_name="My Awesome App" \
scheme="MyApp"Output example:
🔐 Setting up certificates... ✅ Complete
📋 Building MyApp (Release)... ✅ Complete
📤 Uploading to TestFlight... ✅ Complete
⏱️ Processing status: Ready to Test (2m 34s)
🎉 Successfully deployed v1.2.3 build 45 to TestFlight!
What it does: Validates privacy usage descriptions to prevent TestFlight upload failures
- ✅ Prevents ITMS-90683 errors before TestFlight upload
- ✅ 15+ privacy keys validated (Camera, Location, Contacts, Speech Recognition, etc.)
- ✅ Smart Info.plist detection automatically finds your project's Info.plist
- ✅ Quality analysis detects placeholder text and insufficient descriptions
- ✅ Educational guidance with step-by-step fix instructions
# Basic validation (auto-detects Info.plist)
apple-deploy validate scope="privacy" scheme="MyApp"
# Custom Info.plist path
apple-deploy validate scope="privacy" info_plist_path="./MyApp/Info.plist"
# Strict mode (warnings become errors)
apple-deploy validate scope="privacy" scheme="MyApp" strict_mode="true"Output example:
🔒 Privacy Validation
✅ Camera access: 'This app uses the camera to scan documents'
✅ Location when in use: 'This app uses location to find nearby stores'
❌ Speech recognition (NSSpeechRecognitionUsageDescription): Missing description
💡 Fix Instructions:
1. Open your Info.plist file in Xcode
2. Add missing privacy usage description keys
3. Provide clear, user-friendly explanations
📖 Privacy Guide: https://developer.apple.com/documentation/...
Privacy Keys Checked:
- Camera, Microphone, Photo Library access
- Location services (when-in-use, always)
- Personal data (Contacts, Calendars, Reminders)
- Device capabilities (Speech Recognition, Face ID, Motion)
- Health & Fitness data, Bluetooth, Local Network
- User Tracking Transparency (iOS 14.5+)
What it does: Comprehensive validation system with flexible scope targeting
- ✅ Environment validation - Xcode, tools, and system requirements
- ✅ Network connectivity - Internet connection and Apple services
- ✅ API credentials - App Store Connect authentication
- ✅ Privacy validation - Info.plist privacy usage descriptions
- ✅ Certificate health - Certificate and profile validation
- ✅ Project structure - App configuration and build settings
# Complete validation suite
apple-deploy validate \
apple_info_dir="./apple_info" \
team_id="ABC1234567" \
app_identifier="com.mycompany.myapp" \
scheme="MyApp"
# Quick validation (environment and network only)
apple-deploy validate mode="quick"
# Scope-based validation (specific domains)
apple-deploy validate scope="privacy" scheme="MyApp"
apple-deploy validate scope="environment,network"
apple-deploy validate scope="privacy,certs" team_id="ABC1234567"
# Predefined scope combinations
apple-deploy validate scope="essential" # environment + network + authOutput example:
🛡️ Unified Validation System
✅ Environment: Xcode 15.2, Command Line Tools installed
✅ Network: Connected to Apple Developer services
✅ API Credentials: Valid App Store Connect authentication
✅ Privacy: All required usage descriptions present
✅ Certificates: Valid distribution certificate found
✅ Project: App configuration ready for deployment
🎉 All validation checks passed! Ready for deployment.
Validation Scopes:
environment- Xcode, Command Line Tools, system requirementsnetwork- Internet connectivity, Apple Developer servicesauth/authentication- App Store Connect API credentialsprivacy- Info.plist privacy usage descriptionscerts/certificates- Code signing certificates and profilesproject- Xcode project configuration and build settings
Predefined Combinations:
all- Complete validation suite (default)quick- Environment and network only (fastest)essential- Environment, network, and authentication
What it does: Checks TestFlight build status and environment health
- ✅ TestFlight monitoring - Latest build processing status
- ✅ Build history - Last 5 builds with status and metadata
- ✅ Environment check - Certificate and profile health
- ✅ API connectivity - App Store Connect service status
- ✅ Team configuration - Audit of team setup and credentials
# Check specific app status
apple-deploy status \
apple_info_dir="./apple_info" \
team_id="ABC1234567" \
app_identifier="com.mycompany.myapp"
# Quick environment check only
apple-deploy status environment_only="true"Output example:
📊 TestFlight Status & Environment Health
🚀 Latest Build: v1.2.3 build 45
📍 Status: Ready to Test (processed in 2m 34s)
⏰ Uploaded: 2025-01-15 14:32:15 UTC
📋 Recent Builds:
✅ v1.2.3 (45) - Ready to Test - 2 hours ago
✅ v1.2.2 (44) - Ready to Test - 1 day ago
⚠️ v1.2.1 (43) - Rejected - 3 days ago
✅ v1.2.0 (42) - Ready to Test - 5 days ago
🔐 Environment:
✅ Certificates: 2 valid (expires in 347 days)
✅ Profiles: 1 active provisioning profile
✅ API Access: Connected to App Store Connect
What it does: Standalone verification of built IPA files
- ✅ Code signing verification - Validates signing integrity
- ✅ IPA structure analysis - Checks app bundle structure
- ✅ Version validation - Confirms version and build numbers
- ✅ Size analysis - App size and performance metrics
- ✅ Quality checks - Detects common build issues
# Verify specific IPA file
apple-deploy verify_build \
ipa_path="./build/MyApp.ipa" \
expected_version="1.2.3" \
expected_build="45"
# Auto-detect latest build
apple-deploy verify_build scheme="MyApp"Output example:
🔍 IPA Verification & Integrity Check
📱 App: MyApp v1.2.3 build 45
📦 Size: 14.2 MB (optimized)
🔐 Signing: Valid distribution signature
📋 Bundle: Proper app structure detected
✅ Code signing verified with Apple certificate
✅ IPA structure follows Apple guidelines
✅ Version numbers match expectations
✅ App size within reasonable limits
✅ No critical issues detected
🎉 IPA ready for TestFlight upload!
What it does: Creates and imports certificates/profiles without building
- ✅ Downloads existing certificates from Apple Developer Portal
- ✅ Creates new certificates if needed (respects Apple's 2 dev + 3 distribution limit)
- ✅ Generates provisioning profiles for your app
- ✅ Imports everything to temporary keychain for signing
apple-deploy setup_certificates \
apple_info_dir="./apple_info" \
team_id="ABC1234567" \
app_identifier="com.mycompany.myapp"Output example:
🔍 Checking existing certificates...
📥 Found 1 development, 2 distribution certificates
✨ Creating new development certificate
📋 Generating provisioning profile for com.mycompany.myapp
🔐 Importing certificates to keychain
✅ Certificate setup complete! Ready for deployment.
What it does: Sets up the apple_info directory structure in current directory
- ✅ Creates
apple_info/directory with proper structure - ✅ Generates
config.envtemplate with your team settings - ✅ Creates subdirectories for certificates and profiles
- ✅ Provides next-steps guidance
💡 Pro Tip: You can run this anywhere - in your iOS project, in a shared team directory, or in a dedicated credentials folder. No Xcode project required!
# Option 1: Initialize in your iOS project directory
cd /path/to/MyAwesomeApp
apple-deploy init
# Option 2: Initialize in a shared credentials directory
cd /shared/ios-team-credentials
apple-deploy init
# Option 3: Initialize anywhere you want to store Apple credentials
mkdir ~/my-ios-credentials && cd ~/my-ios-credentials
apple-deploy initWhat it creates:
current-directory/
├── apple_info/ # 📁 Created by init
│ ├── certificates/ # 📁 For .p12 files
│ ├── profiles/ # 📁 For .mobileprovision files
│ └── config.env # 📄 Template configuration
└── (other files in current directory remain unchanged)
Output example:
🚀 Initializing Apple Deploy structure...
📁 Created: apple_info/certificates/
📁 Created: apple_info/profiles/
📄 Created: apple_info/config.env (from template)
✅ Project initialized successfully!
NEXT STEPS:
1. Add your Apple Developer credentials to apple_info/:
- API key file: apple_info/AuthKey_XXXXX.p8
- Certificates: apple_info/certificates/*.p12
2. Edit apple_info/config.env with your team details
3. Run your first deployment:
apple-deploy deploy team_id="YOUR_TEAM_ID" app_identifier="com.your.app" [...]
team_id="YOUR_TEAM_ID" # Apple Developer Team ID (10-character)
app_identifier="com.yourcompany.app" # Bundle identifier (reverse DNS)
apple_id="your@email.com" # Apple Developer account email
api_key_id="YOUR_KEY_ID" # App Store Connect API Key ID
api_issuer_id="your-issuer-uuid" # API Issuer ID (UUID format)
app_name="Your App Name" # Display name for TestFlight
scheme="YourScheme" # Xcode build scheme name# Apple Credentials Directory
apple_info_dir="./apple_info" # Apple credentials directory (default: ./apple_info)
apple_info_dir="/path/to/shared/apple_info" # Or absolute path for shared/custom locations
# API Key (auto-detected if not specified)
api_key_path="AuthKey_XXXXX.p8" # API key filename (auto-detected)
# Version Management
version_bump="patch" # patch|minor|major (default: patch)
# Build Configuration
configuration="Release" # Build configuration (default: Release)
# TestFlight Options
testflight_enhanced="true" # Enhanced confirmation & logging (default: false)
# Privacy Validation (NEW!)
privacy_validation="strict" # strict|warn|skip (default: strict)
privacy_validation="warn" # Continue deployment with warnings
privacy_validation="skip" # Bypass privacy validation entirely
# Security
p12_password="YourPassword" # P12 certificate password (prompts if needed)/path/to/secure/apple_info/ # Shared credentials directory
├── YOUR_TEAM_ID/ # Team ID directory
│ ├── AuthKey_XXXXX.p8 # Team's API key
│ ├── certificates/ # Team certificates (P12 files)
│ │ ├── development.p12 # Development certificate
│ │ └── distribution.p12 # Distribution certificate
│ ├── profiles/ # Provisioning profiles
│ │ ├── Development_*.mobileprovision
│ │ └── AppStore_*.mobileprovision
│ └── config.env # Team configuration
├── ABC1234567/ # Another team
└── DEF7890123/ # Third team
my_app/ # Your iOS app directory
├── MyApp.xcodeproj # Xcode project
├── MyApp.xcworkspace # Xcode workspace (if using CocoaPods)
└── fastlane/ # Runtime scripts (auto-copied)
my_app/
├── apple_info/ # Local Apple credentials
│ ├── YOUR_TEAM_ID/ # Team ID directory
│ │ ├── AuthKey_XXXXX.p8 # API key
│ │ ├── certificates/ # P12 certificates
│ │ ├── profiles/ # Provisioning profiles
│ │ └── config.env # Configuration
│ └── ABC1234567/ # Another team
├── MyApp.xcodeproj/ # Xcode project
└── fastlane/ # Runtime scripts
For developers joining an existing team with shared certificates
# 1. Install apple-deploy and get project
brew tap snooky23/tools && brew install apple-deploy
git clone your-team-ios-project && cd your-app
# 2. Initialize and import team certificates
apple-deploy init
# Copy shared team credentials to apple_info/
# 3. Deploy immediately - it just works!
apple-deploy deploy \
apple_info_dir="./apple_info" \
team_id="YOUR_TEAM_ID" \
app_identifier="com.yourteamapp" \
apple_id="your@email.com" \
api_key_id="YOUR_KEY_ID" \
api_issuer_id="your-issuer-uuid" \
app_name="Your App" \
scheme="YourScheme"For the first person setting up certificates for the entire team
# 1. Install and initialize team project
brew tap snooky23/tools && brew install apple-deploy
cd your-team-app && apple-deploy init
# 2. Create and export team certificates
apple-deploy deploy \
apple_info_dir="./apple_info" \
team_id="YOUR_TEAM_ID" \
app_identifier="com.yourteamapp" \
apple_id="your@email.com" \
api_key_id="YOUR_KEY_ID" \
api_issuer_id="your-issuer-uuid" \
app_name="Your Team App" \
scheme="YourScheme"
# 3. Share apple_info/ directory with team
# Team members copy the apple_info/ folder to their projects- ✅ One-time certificate setup by team lead creates shared P12 files
- ✅ 5-minute onboarding for any new team member
- ✅ Cross-machine compatibility - certificates work on any Mac
- ✅ Shared Apple Developer account - no individual accounts needed
- ✅ Team isolation - complete separation between different teams/projects
# Semantic versioning with automatic conflict resolution
apple-deploy deploy apple_info_dir="./apple_info" version_bump="patch" [...] # 1.0.0 → 1.0.1
apple-deploy deploy apple_info_dir="./apple_info" version_bump="minor" [...] # 1.0.0 → 1.1.0
apple-deploy deploy apple_info_dir="./apple_info" version_bump="major" [...] # 1.0.0 → 2.0.0🚀 NEW: Automatic Build Number Conflict Resolution
- ✅ Intelligent TestFlight checking - queries existing builds before upload
- ✅ Zero-config conflict resolution - automatically increments build numbers when conflicts exist
- ✅ Works with all version_bump types - patch, minor, and major all include conflict resolution
- ✅ Prevents upload failures - no more "build already exists" errors
How it works:
- Increment version according to your chosen strategy (patch/minor/major)
- Automatically check TestFlight for existing builds with that version
- If build number conflicts exist, automatically increment until finding an available number
- Upload with guaranteed unique version + build combination
Example automatic resolution:
# You request: version 1.0.5, build 32
# TestFlight has: builds 32, 33, 34 for version 1.0.5
# System resolves: automatically uses build 35
# Result: Upload succeeds with version 1.0.5 build 35# Standard upload (fast) - 3-5 minutes total
apple-deploy deploy apple_info_dir="./apple_info" [...]
# Enhanced mode - wait for Apple processing completion
apple-deploy deploy apple_info_dir="./apple_info" testflight_enhanced="true" [...]
# Check TestFlight status anytime
apple-deploy status apple_info_dir="./apple_info" team_id="YOUR_TEAM_ID" app_identifier="com.yourapp"Enhanced Mode Features:
- ⏱️ Upload duration tracking with performance metrics
- 🔄 Real-time processing status monitoring
- 📊 Build history display (last 5 TestFlight builds)
- 📝 Advanced audit logging in config.env
- ✅ Processing confirmation until "Ready to Test"
The platform uses intelligent build logic that automatically resolves common signing issues:
Attempt 1: Automatic Signing ⚡
- Lets Xcode handle signing automatically
- Fastest approach for properly configured projects
Attempt 2: Manual Signing with Smart Matching 🧠
- Automatically switches to manual signing
- Intelligently matches certificate types to profile types:
- AppStore profiles → Distribution certificates
- Development profiles → Development certificates
- Configures Xcode project with correct certificate/profile pairs
Attempt 3: Certificate Mismatch Recovery 🔧
- Detects "doesn't include signing certificate" errors
- Analyzes keychain for available certificates
- Automatically reconfigures project with correct certificate
- Updates project.pbxproj directly if needed
- ✅ Certificate Type Mismatches: AppStore profiles matched with development certificates
- ✅ "Provisioning profile required" errors: Automatic project configuration
- ✅ "Doesn't include signing certificate" errors: Smart certificate selection
- ✅ Manual intervention: Complete automation of signing configuration
| Metric | Traditional | Automated | Improvement |
|---|---|---|---|
| Deployment Time | 2-4 hours | ~1 minute | 98% faster |
| TestFlight Success | 60-80% | 100% | Eliminates failures |
| Team Onboarding | 2-3 days | 5 minutes | 99% faster |
| Version Conflicts | 15-30% fail | 0% conflicts | 100% reliable |
🔐 Certificate Setup: 4 seconds
📋 Project Validation: 1 second
📈 Version Management: 1 second (auto-increment from TestFlight)
🔨 iOS Build Process: 15 seconds
☁️ TestFlight Upload: 40 seconds (14.1MB/s transfer)
✅ Upload Verification: 1 second
─────────────────────────────────────────
💫 Total Pipeline: ~67 seconds
🎉 Upload Status: SUCCESS (0 warnings, 0 messages)
# Test your environment before deployment
apple-deploy status \
apple_info_dir="/path/to/secure/apple_info" \
team_id="YOUR_TEAM_ID" \
app_identifier="com.yourapp"
# Test privacy validation specifically
apple-deploy validate scope="privacy" scheme="YourScheme"🔒 Privacy Validation Issues (NEW!)
The most common cause of TestFlight upload failures in iOS apps
🚨 ITMS-90683 Error: Missing purpose string in Info.plist
Your app's code references one or more APIs that access sensitive user data.
The Info.plist file should contain a NSSpechRecognitionUsageDescription key
with a user-facing purpose string explaining clearly and completely why your
app needs the data.
✅ IMMEDIATE FIX:
# 1. Run privacy validation to see exactly what's missing
apple-deploy validate scope="privacy" scheme="YourApp"
# 2. Add missing keys to your Info.plist in Xcode:
# - Right-click Info.plist → Open As → Property List
# - Add the missing keys with clear descriptions📝 EXAMPLE PRIVACY STRINGS:
<key>NSCameraUsageDescription</key>
<string>This app uses the camera to scan documents and capture photos for your profile.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>This app uses speech recognition to convert voice commands into text for hands-free operation.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app uses your location to show nearby restaurants and provide directions.</string>🔧 VALIDATION MODES:
# Strict mode (stops deployment on privacy issues)
apple-deploy deploy privacy_validation="strict" [...]
# Warning mode (continues with warnings)
apple-deploy deploy privacy_validation="warn" [...]
# Skip validation (not recommended)
apple-deploy deploy privacy_validation="skip" [...]📖 PRIVACY KEYS REFERENCE:
NSCameraUsageDescription- Camera accessNSMicrophoneUsageDescription- Microphone accessNSPhotoLibraryUsageDescription- Photo library accessNSLocationWhenInUseUsageDescription- Location when in useNSSpeechRecognitionUsageDescription- Speech recognitionNSContactsUsageDescription- Contacts accessNSFaceIDUsageDescription- Face ID authenticationNSUserTrackingUsageDescription- App tracking transparency (iOS 14.5+)
💡 BEST PRACTICES:
- Be specific about WHY you need the permission
- Avoid generic phrases like "This app uses your camera"
- Explain the user benefit clearly
- Use friendly, non-technical language
- Test with
apple-deploy validate scope="privacy"before deployment
🚨 "API key file not found" Error
Quick Fix:
# Check your API key path
ls -la /path/to/secure/apple_info/YOUR_TEAM_ID/AuthKey_*.p8
# If not found, move it to the right location
mv ~/Downloads/AuthKey_*.p8 /path/to/secure/apple_info/YOUR_TEAM_ID/Directory structure should look like:
/path/to/secure/apple_info/
└── YOUR_TEAM_ID/
├── AuthKey_XXXXX.p8 ← Must be here
├── certificates/
└── profiles/
🚨 "App icon is missing" or TestFlight Upload Fails
This is the #1 cause of first-time deployment failures!
Apple requires a proper app icon before TestFlight uploads. The build will fail with errors like:
- "The app bundle does not contain an app icon for iPhone"
- "App icon is missing"
- "Invalid bundle - missing CFBundleIconName"
Quick Fix:
-
Add App Icon to Xcode Project:
YourApp.xcodeproj → Assets.xcassets → AppIcon -
Required Icon Sizes (iOS):
- 20x20, 29x29, 40x40, 58x58, 60x60, 76x76, 80x80, 87x87, 120x120, 152x152, 167x167, 180x180, 1024x1024
-
Quick Solution - Use App Icon Generator:
- Visit appicon.co or similar
- Upload your 1024x1024 icon
- Download and drag all sizes into Xcode's AppIcon asset
-
Verify Icon is Set:
# Check your project settings apple-deploy status apple_info_dir="./apple_info" team_id="YOUR_TEAM_ID" app_identifier="com.yourapp"
After adding the icon, retry deployment - it should work immediately! ✅
🚨 "Missing required apple_info_dir parameter"
The apple_info_dir parameter is only required for custom locations. For local projects, it defaults to ./apple_info:
# ✅ Local project (after apple-deploy init) - parameter optional
apple-deploy deploy \
team_id="YOUR_TEAM_ID" \
app_identifier="com.yourapp" [...]
# ✅ Custom/shared location - specify absolute path
apple-deploy deploy \
apple_info_dir="/Users/john/shared_apple_info" \
team_id="YOUR_TEAM_ID" [...]🚨 TestFlight upload fails with API key errors
This has been resolved in production. The platform automatically handles xcrun altool API key location requirements:
- Copies your API key to
~/.appstoreconnect/private_keys/ - Runs the upload command
- Cleans up the temporary API key copy
No action required - this works automatically.
⚠️ "Version already exists on TestFlight"
The platform prevents this automatically by checking TestFlight for the latest build number and incrementing appropriately.
Manual version control:
# Force version increment
apple-deploy deploy \
apple_info_dir="./apple_info" \
version_bump="patch" \
team_id="YOUR_TEAM_ID" [...]🚨 "Invalid trust settings" Certificate Error (FIXED in v2.12.3)
Error Message:
❌ Invalid trust settings. Restore system default trust settings for certificate
"Apple Distribution: Your Name (TEAM_ID)" in order to sign code with it.What This Means: CI/CD environments and some developer machines reject certificates for code signing due to security restrictions, even when certificates are valid.
✅ AUTOMATICALLY FIXED in v2.12.3:
- Universal certificate trust solution works automatically in background
- Zero configuration required - applies to all projects and teams
- CI/CD compatible - completely non-interactive operation
- Works with all certificate types - Development, Distribution, Enterprise
How to Get the Fix:
# Upgrade to v2.12.3
brew upgrade apple-deploy
# Verify version
apple-deploy version # Should show v2.12.7+Note: This fix is automatic and requires no configuration. It works silently during certificate setup.
🚨 "Not in an iOS project directory" Error (FIXED in v2.12.2)
Error Message:
❌ Error: Not in an iOS project directory
Please run this command from your iOS project root directory✅ FIXED in v2.12.2:
- Improved project detection works correctly from any valid iOS project
- Enhanced working directory handling prevents location confusion
How to Get the Fix:
# Upgrade to v2.12.2+
brew upgrade apple-deploy
# Test from your iOS project directory
cd /path/to/your-ios-project
apple-deploy help # Should work without errorsEnable detailed logging:
DEBUG_MODE=true VERBOSE_MODE=true \
apple-deploy deploy apple_info_dir="./apple_info" [...]
# Check the generated log file
cat build/logs/deployment_*.logPROBLEM SOLVED: "Invalid trust settings. Restore system default trust settings for certificate" errors
CI/CD environments often failed with certificate trust errors during code signing, even when certificates were valid and properly imported.
- Generic certificate trust permissions via
security set-key-partition-list - Works with ANY keychain path and ANY certificates
- CI/CD compatible - completely non-interactive operation
- Emergency keychain cleanup - prevents accumulation in failed deployments
- Bulletproof error handling - graceful degradation if trust setting fails
- Core Implementation:
scripts/domain/use_cases/setup_keychain.rb:283-302 - Integration Point: Runs automatically after keychain creation
- Zero Configuration - works out of the box for all projects and teams
Result: Universal fix that resolves certificate trust issues across all iOS projects, certificate types, and CI/CD environments.
- Production-Verified TestFlight Pipeline with xcrun altool integration
- Enhanced Certificate Management - seamless CI/CD integration with automatic configuration
- Intelligent Certificate/Profile Matching with automatic type detection and alignment
- Smart Provisioning Profile Management with reuse capabilities
- 3-Attempt Build Failover System with automatic signing configuration
- Multi-Team Directory Structure with complete team isolation
- Intelligent Version Management with TestFlight conflict prevention
- Advanced Keychain Security - complete isolation with enterprise-grade certificate management
- Enhanced TestFlight Confirmation with real-time status polling
- Domain-Driven Design with comprehensive business logic in Ruby entities
- 95%+ Test Coverage with 1,600+ lines of unit tests across domain entities
- Dependency Injection Container with advanced service management and health checks
- Repository Pattern Interfaces with 80+ methods for clean system integration
- Modular Use Case Extraction for key workflows with proven stability
- Apple API Abstraction Layer for certificate and profile operations
- Certificate Entity: 445 lines of business logic with Apple certificate limits
- ProvisioningProfile Entity: 600+ lines with wildcard matching and platform support
- Application Entity: 650+ lines with semantic versioning and App Store validation
- Comprehensive Unit Tests: Certificate (279 lines), Profile (695 lines), Application (699 lines)
- Battle-Tested Monolithic Design with proven FastLane integration
- Temporary API Key Handling with automatic cleanup
- Isolated Keychain System with zero system interference
- Comprehensive Audit Logging with deployment history tracking
- Team Directory Isolation with secure file permissions
- Business Rule Validation with comprehensive error checking and edge case handling
- ✅ MAJOR: Working Directory Fix - Fixed CLI wrapper to execute from user's project directory instead of installation directory
- 🚀 RESOLVED: "No Xcode project found" Error - apple-deploy now correctly detects .xcodeproj files from your iOS project
- 🔧 WORKING: Complete Deployment Flow - All commands (deploy, build_and_upload, setup_certificates) now function properly
- ⚡ TESTED: End-to-End Verification - Full deployment pipeline verified and operational
- ✅ Project Detection Fix - Fixed iOS project directory detection for proper .xcodeproj recognition
- 🚀 Enhanced CLI Validation - Improved project structure validation in apple-deploy command
- 🔧 Better Error Messages - Clearer feedback when not in iOS project directory
- ✅ Command Alignment - Changed command from
ios-deploytoapple-deployfor consistency - 🚀 Unified Branding - All references now use "Apple Deploy" instead of "iOS FastLane Auto Deploy"
- 📊 Version Management - Updated all components to v2.12.0 for consistency
- 🔧 Enhanced User Experience - Cleaner command interface aligned with package name
- 📚 Documentation Updates - All docs updated to reflect new command structure
- ✅ Homebrew Installation Fixed - Resolved file overwrite conflicts during installation
- 🚀 Enhanced Keychain Cleanup - Fixed .ff* temporary file accumulation issues
- 📊 Improved Error Handling - Better cleanup and installation process
- ✅ 100% TestFlight Success Rate - Proven end-to-end deployment capability
- ✅ xcrun altool Integration - Fixed API key location issues for reliable uploads
- ✅ Enhanced Processing Monitoring - Real-time TestFlight build status tracking
- ✅ Smart Version Conflict Resolution - Automatic handling of build number conflicts
- ✅ Multi-Team Directory Structure - Complete team isolation and collaboration support
Deploy your iOS app in 1 minute instead of 4 hours
✅ Production-verified with successful TestFlight uploads
brew tap snooky23/tools
brew install apple-deploycd /path/to/your-ios-app
apple-deploy initapple-deploy deploy \
apple_info_dir="./apple_info" \
team_id="YOUR_TEAM_ID" \
app_identifier="com.yourapp" \
apple_id="your@email.com" \
api_key_id="YOUR_KEY_ID" \
api_issuer_id="your-issuer-uuid" \
app_name="Your App" \
scheme="YourScheme"⭐ Star this repo if it saved your team hours of deployment time!
- Development Teams seeking reliable iOS deployment automation with 100% TestFlight success
- Enterprise Organizations requiring secure, auditable deployment pipelines
- Startups wanting to focus on product instead of DevOps complexity
- Consultancies managing multiple iOS projects with different Apple Developer teams
Production Status: FULLY OPERATIONAL ✅
Built for enterprise teams. Production-verified.
- 📖 Complete Setup Guide: docs/setup.md - Detailed setup from Apple account to deployment
- 🏗️ Technical Architecture: docs/architecture.md - Clean Architecture implementation details
- 🔒 Security Practices: docs/security.md - Enterprise security guidelines
- 🐛 Report Issues: GitHub Issues