AgentSkillsCN

Ios Build Doctor

iOS 构建医生

SKILL.md

iOS Build Doctor Skill

Purpose

Diagnose and automatically fix iOS build issues. This skill analyzes Xcode build logs, identifies common errors, and applies fixes to get projects building successfully.

Capabilities

  • Parse and analyze Xcode build logs
  • Fix "cannot find type in scope" errors
  • Resolve module import issues
  • Clean derived data and caches
  • Fix Info.plist configuration issues
  • Update build settings automatically
  • Generate detailed diagnostic reports

Usage

When encountering build errors, I will:

  1. Capture build output from xcodebuild or Xcode
  2. Analyze error patterns to identify root causes
  3. Apply automated fixes for known issues
  4. Clean caches if necessary
  5. Verify fixes with a test build
  6. Generate report of actions taken

Common Tasks

Diagnose build failure

python
python build_analyzer.py --log build.log --project YourApp.xcodeproj

Fix scope errors

python
python scope_fixer.py --project YourApp.xcodeproj --error "Cannot find type 'AppState' in scope"

Clean and rebuild

bash
./clean_build.sh YourApp.xcodeproj

Resources

  • build_analyzer.py - Parse and analyze build logs
  • scope_fixer.py - Fix import and scope issues
  • clean_build.sh - Deep clean build artifacts
  • diagnostics.json - Common error patterns and fixes
  • build_settings_fixer.py - Update project build settings

Error Patterns Handled

Scope Errors

  • "Cannot find type in scope"
  • "Use of unresolved identifier"
  • "No such module"

Build Configuration

  • Module not enabled
  • Swift version mismatches
  • Target membership issues

File System

  • Missing file references
  • Incorrect paths
  • Derived data corruption

Signing & Capabilities

  • Provisioning profile issues
  • Entitlements mismatches
  • Bundle identifier conflicts

Diagnostic Process

  1. Parse error messages
  2. Identify error category
  3. Check diagnostics database
  4. Apply relevant fixes
  5. Verify resolution
  6. Document actions taken

Best Practices

  1. Always backup before applying fixes
  2. Start with least invasive fixes
  3. Clean incrementally (not nuclear option first)
  4. Verify each fix before proceeding
  5. Document unusual fixes for future reference