Skip to content
Development
Skill

/ios-testing-patterns

XCTest and XCUITest execution workflows and flaky test detection patterns

From plugin
xclaude-plugin
1888 skills2 MCP

Claude Code

$ npx -y skills add conorluddy/xclaude-plugin --skill ios-testing-patterns --agent claude-code

SKILL.md

ios-testing-patterns.SKILL.md
name: ios-testing-patterns
description: XCTest and XCUITest execution workflows and flaky test detection patterns
version: 0.0.1
token_cost: ~40

iOS Testing Patterns Skill

**Comprehensive guide to XCTest and XCUITest execution, analysis, and flaky test detection**

Overview

This skill provides patterns and workflows for executing iOS tests using XCTest and XCUITest frameworks. It covers test execution strategies, result analysis, flaky test detection, and troubleshooting common test failures.

**Use this skill when:**

  • Running unit tests or UI tests
  • Analyzing test failures
  • Detecting and debugging flaky tests
  • Optimizing test execution performance
  • Setting up CI/CD test pipelines

Quick Reference

| Task | Operation | Key Parameters | | ------------------ | --------- | ---------------------- | | Run all tests | `test` | scheme, destination | | Run specific test | `test` | scheme, only_testing | | Skip tests | `test` | scheme, skip_testing | | Use test plan | `test` | scheme, test_plan | | Parallel execution | `test` | destination (multiple) |

When to Use This Skill

**Use ios-testing-patterns when:**

  • Executing XCTest unit tests
  • Running XCUITest UI automation tests
  • Investigating test failures
  • Detecting intermittent test failures (flaky tests)
  • Analyzing test performance and execution time
  • Setting up test schemes and test plans
  • Configuring parallel test execution
  • Debugging test-specific simulator issues

**Related Skills:**

  • **xcode-workflows**: For general build and test operations
  • **simulator-workflows**: For managing test simulators
  • **ui-automation-workflows**: For UI test interaction patterns

Key Concepts

XCTest vs XCUITest

**XCTest (Unit/Integration Tests):**

  • Fast execution (milliseconds to seconds)
  • Tests individual components in isolation
  • Direct access to app internals
  • No UI interaction required
  • Runs in same process as app code

**XCUITest (UI Tests):**

  • Slower execution (seconds to minutes)
  • Tests user-facing workflows
  • Black-box testing (no app internals)
  • Requires simulator/device UI
  • Runs in separate process

Test Execution Strategies

**Sequential Execution:**

  • Tests run one after another
  • Predictable, repeatable results
  • Slower overall execution
  • Better for debugging

**Parallel Execution:**

  • Tests run simultaneously on multiple simulators
  • Faster overall execution
  • Requires more system resources
  • May expose race conditions

**Test Sharding:**

  • Split test suite across multiple destinations
  • Optimal for CI/CD pipelines
  • Reduces total execution time
  • Requires careful test isolation

Workflows

1. Running Unit Tests

**Basic Unit Test Execution:**

{
  "operation": "test",
  "scheme": "MyApp",
  "destination": "platform=iOS Simulator,name=iPhone 15,OS=18.0"
}

**Note:** The destination parameter now supports auto-resolution! You can omit the OS version (e.g., `"platform=iOS Simulator,name=iPhone 15"`) and the tool will automatically select the latest available OS version for that device.

**Run Specific Test Class:**

{
  "operation": "test",
  "scheme": "MyApp",
  "destination": "platform=iOS Simulator,name=iPhone 15,OS=18.0",
  "options": {
    "only_testing": ["MyAppTests/NetworkTests"]
  }
}

**Run Specific Test Method:**

{
  "operation": "test",
  "scheme": "MyApp",
  "destination": "platform=iOS Simulator,name=iPhone 15,OS=18.0",
  "options": {
    "only_testing": ["MyAppTests/NetworkTests/testAPIRequest"]
  }
}

2. Running UI Tests

**Basic UI Test Execution:**

{
  "operation": "test",
  "scheme": "MyAppUITests",
  "destination": "platform=iOS Simulator,name=iPhone 15"
}

**UI Tests with Specific Device:**

{
  "operation": "test",
  "scheme": "MyAppUITests",
  "destination": "platform=iOS Simulator,name=iPad Pro (12.9-inch)"
}

**UI Tests with Test Plan:**

{
  "operation": "test",
  "scheme": "MyApp",
  "destination": "platform=iOS Simulator,name=iPhone 15",
  "options": {
    "test_plan": "SmokeTests"
  }
}

3. Parallel Test Execution

**Multiple Destinations:**

Run tests on multiple simulators simultaneously:

{
  "operation": "test",
  "scheme": "MyApp",
  "destination": [
    "platform=iOS Simulator,name=iPhone 15",
    "platform=iOS Simulator,name=iPhone SE (3rd generation)"
  ],
  "options": {
    "parallel": true
  }
}

**Parallel Test Benefits:**

  • Reduces total execution time
  • Tests across multiple device types
  • Exposes device-specific issues
  • Better CI/CD performance

**Parallel Test Considerations:**

  • Requires multiple simulators
  • Higher CPU/memory usage
  • May expose race conditions
  • Test isolation critical

4. Test Filtering

**Skip Specific Tests:**

{
  "operation": "test",
  "scheme": "MyApp",
  "destination": "platform=iOS Simulator,name=iPhone 15",
  "options": {
    "skip_testing": [
      "MyAppUITests/SlowTests",
      "MyAppTests/NetworkTests/testLargeDownload"
    ]
  }
}

**Run Only Fast Tests:**

{
  "operation": "test",
  "scheme": "MyApp",
  "destination": "platform=iOS Simulator,name=iPhone 15",
  "options": {
    "only_testing": ["MyAppTests/UnitTests"],
    "skip_testing": ["MyAppTests/UnitTests/testSlowOperation"]
  }
}

5. Test Result Analysis

**Success Response:**

{
  "success": true,
  "tests_run": 45,
  "tests_passed": 45,
  "tests_failed": 0,
  "execution_time": "12.4s",
  "scheme": "MyApp"
}

**Failure Response:**

{
  "success": false,
  "tests_run": 45,
  "tests_passed": 43,
  "tests_failed": 2,
  "failures": [
    {
      "test": "MyAppTests.LoginTests.testInvalidPassword",
      "message": "XCTAssertEqual failed: (\"error\") is not equal to (\"invalid\")",
      "file": "LoginTests.swift",
      "line": 42
    },
    {
      "test": "MyAppUITests.CheckoutTests.testPaymentFlow",
      "message": "Failed to fin
Read more
@conorluddy
Ships withxclaude-plugin

Modular iOS development automation for Claude Code Build, test, and automate iOS apps through natural conversation with Claude. 8 workflow-specific MCP servers with 24 tools across Xcode, Simulator, and IDB. Enable only what you need.

1888 skills2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
188
Star history of conorluddy/xclaude-plugin on GitHub, a chart by star-history.com

Other skills on xclaude-plugin.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about ios-testing-patterns.

Which coding agents can use ios-testing-patterns?
ios-testing-patterns installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.