Best for
- Choosing the right iOS test layer
- Running or debugging XCTest, XCUITest, or Swift Testing from CLI
- Stabilizing flaky UI tests
vasilyu1983/AI-Agents-public/frameworks/shared-skills/skills/qa-testing-ios/SKILL.md
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
Decision brief
High-signal iOS test execution and flake control for XCTest, XCUITest, Swift Testing, xcodebuild, xcresult, and simctl.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Declared | Source record | Install path and trigger |
| Claude Code | Declared | Source record | Install path and trigger |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/qa-testing-ios"Inspect the Agent Skill "qa-testing-ios" from https://github.com/vasilyu1983/AI-Agents-public/blob/53f6cb73ea53a2646e3e7d4665062ad66f3683ac/frameworks/shared-skills/skills/qa-testing-ios/SKILL.md at commit 53f6cb73ea53a2646e3e7d4665062ad66f3683ac. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Review the “Quick Start” section in the pinned source before continuing.
Resolve the build inputs first: workspace or project, scheme, test plan, destination, and required launch hooks.
Review the “Quick Reference” section in the pinned source before continuing.
Do not treat simulator green or archive green as full iOS release proof when the feature depends on distribution signing, real hardware, APNs, camera, biometrics, purchases, or background execution.
New unit and integration tests: prefer Swift Testing unless the project is already standardized on XCTest.
Permission review
The documentation asks the agent to read local files, directories, or repositories.
| Persist booted UDID to `.simulator-udid` (gitignored) in the `select-simulator.sh` step | Stop scripts read this file back and call `xcrun simctl shutdown <UDID>` plus `xcrun simctl terminate <UDID> <bundle-id>` — terminating exactly the The documentation includes network, browsing, or remote request actions.
Use web search or web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 99/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 80 | Source | Repository attention, not individual Skill quality |
| Compatibility | 2 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
High-signal iOS test execution and flake control for XCTest, XCUITest, Swift Testing, xcodebuild, xcresult, and simctl.
Pair this skill with software-ios-native when the work is part of a native iOS rewrite or a Codex / Claude Code implementation loop.
Core docs:
| Need | Go to |
|---|---|
| Run the iOS test workflow | ## Workflow |
| Load current defaults and command patterns | ## Defaults and ## xcodebuild Patterns |
| Control flakes and destinations | ## Flake Control |
| Load templates and references | ## Navigation |
xcresult artifacts always enabled.SWIFT_TESTING_XCTEST_INTEROP_MODE=limited in your test plan environment.-workspace or -project-scheme and optional -testPlanxcresult, coverage, screenshots, logs, diagnostics| Command | Purpose |
|---|---|
xcodebuild -list -workspace MyApp.xcworkspace | List schemes |
xcodebuild -scheme MyApp -showdestinations | Show valid destinations |
xcodebuild -scheme MyApp -showTestPlans | Show available test plans |
xcrun xctrace list devices | List physical and simulator devices |
xcrun simctl list devices available | List available simulators |
xcrun simctl boot "<simulator-name>" | Boot a simulator |
xcrun simctl bootstatus booted -b | Wait for boot completion |
xcrun simctl uninstall booted <bundle-id> | Remove stale installed app before a smoke pass |
Persist booted UDID to .simulator-udid (gitignored) in the select-simulator.sh step | Stop scripts read this file back and call xcrun simctl shutdown <UDID> plus xcrun simctl terminate <UDID> <bundle-id> — terminating exactly the simulator that was booted. Replaces pkill -f Simulator, which shotguns unrelated dev / CI simulators. The UDID file is the contract between run and stop scripts. |
xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=<simulator-name>,OS=latest' -resultBundlePath TestResults.xcresult | Run tests on a simulator |
xcodebuild test -scheme MyApp -destination 'platform=iOS,id=<UDID>' -resultBundlePath TestResults.xcresult | Run tests on a device |
xcodebuild build-for-testing ... then xcodebuild test-without-building ... | Faster reruns |
xcrun xcresulttool get --path TestResults.xcresult --format json | Inspect results programmatically |
xcodebuild ... -destination "generic/platform=iOS" build | Compile-only build without a simulator |
xcodebuild archive -scheme MyApp -destination 'generic/platform=iOS' | Exercise archive/signing path |
-resultBundlePath, and add coverage or diagnostics only when they serve the task.xcresult first, then reproduce a single failing test with -only-testing.xcresult, destinations, and flake control after the app is buildable and installable..app bundles, missing executables, or install/launch failures, route to software-ios-runtime-debugging.# Enumerate before an expensive run
xcodebuild test \
-scheme MyApp \
-testPlan Smoke \
-destination 'platform=iOS Simulator,name=<simulator-name>,OS=latest' \
-enumerate-tests \
-test-enumeration-format json
# Target one test
xcodebuild test \
-scheme MyApp \
-destination 'platform=iOS Simulator,name=<simulator-name>,OS=latest' \
-only-testing:MyAppUITests/LoginFlowTests/testHappyPath \
-resultBundlePath TestResults.xcresult
# Parallelize only when the suite is isolation-safe
xcodebuild test \
-scheme MyApp \
-destination 'platform=iOS Simulator,name=<simulator-name>,OS=latest' \
-parallel-testing-enabled YES \
-maximum-parallel-testing-workers 4 \
-resultBundlePath TestResults.xcresult
# Controlled retry for CI triage
xcodebuild test \
-scheme MyApp \
-destination 'platform=iOS Simulator,name=<simulator-name>,OS=latest' \
-retry-tests-on-failure \
-test-iterations 2 \
-test-repetition-relaunch-enabled YES \
-collect-test-diagnostics on-failure \
-resultBundlePath TestResults.xcresult
# Prove a flake locally
xcodebuild test \
-scheme MyApp \
-destination 'platform=iOS Simulator,name=<simulator-name>,OS=latest' \
-only-testing:MyAppUITests/LoginFlowTests/testHappyPath \
-run-tests-until-failure \
-test-iterations 25
waitForExistence, expectations, and state-based assertions over sleeps.-testLanguage and -testRegion when locale affects assertions.LocalizationStore.text / generated-catalog lookups are testable defects, not acceptable runtime assertions. Add or run catalog coverage before returning to UI polish.For auth, onboarding, billing, referral, and other backend-coupled flows, prefer a fixture-backed launch-environment harness over live credentials. Keep user variants explicit, keep the fixture branch in the same function as the real path, and treat .accessibilityIdentifier() strings as part of the test contract.
Load references/e2e-harness-and-selectors.md for:
Xcode test plans (.xctestplan) control which tests run, with what configuration, and in which environment. Use them to manage matrix-style test execution:
-testLanguage / -testRegion overrides per configuration.-testPlan PlanName in xcodebuild.AI-native tools now generate, execute, and maintain iOS UI tests with minimal manual scripting. Use them as a complement to XCUITest, not a replacement.
Current positioning:
Maestro + MaestroGPT + Maestro MCP: fast smoke and onboarding flow authoringTestSprite: self-healing AI-owned test generation and maintenanceDrizz: visual validation for design-heavy iOS apps| Scenario | Use |
|---|---|
| PR gate smoke tests (fast, deterministic) | XCUITest |
| Broad flow coverage with low authoring effort | Maestro + MaestroGPT |
| Self-healing test maintenance | TestSprite or Appium MCP |
| Visual correctness validation | Drizz |
| Deep state/network assertions | XCUITest |
| Release-candidate E2E sweep | Drizz + real device matrix |
For fuller tool coverage, MCP integration patterns, and the decision framework, load qa-testing-mobile/references/ai-native-testing.md.
xcresult bundles and deciding the next reproduction step| Scenario | Use Instead |
|---|---|
| Product architecture, app implementation, SwiftUI rewrite, or Xcode agent workflow | software-ios-native |
| Build/install failures, stale app suspicion, bundle executable missing, or simulator/package debugging | software-ios-runtime-debugging |
| Cross-platform mobile test strategy | qa-testing-mobile |
| Release-wide quality strategy | qa-testing-strategy |
waitForExistence and expectations over sleeps-testLanguage and -testRegion when locale affects assertions-resultBundlePath artifacts for every CI rungeneric/platform=iOS destination when simulator service is crashed or unavailable — validates Swift compilation without requiring a running simulatorCodable decoders with hand-crafted JSON payloads for missing, null, and unexpected fields — especially for API response models where the backend has evolved. Use JSONDecoder().decode(T.self, from: json) with minimal payloads that omit optional fields and payloads that include unknown keys. Focus on fields the backend has changed or may omit.| Resource | Purpose |
|---|---|
| references/e2e-harness-and-selectors.md | Deterministic fixture harnesses, selector discipline, and E2E landing rules |
| references/swift-testing.md | Comprehensive Swift Testing: assertions, parameterized tests, tags, traits, async patterns, confirmations, Swift 6.2 features, Xcode 26 additions (image attachments, severity levels, XCTest interop change), and XCTest migration |
| references/xctest-patterns.md | XCTest patterns for unit, integration, and performance tests |
| references/xcuitest-patterns.md | XCUITest authoring and flake control |
| references/simulator-commands.md | Current simctl commands worth using in automation |
| references/snapshot-testing-ios.md | Snapshot testing with current caveats |
| references/ios-ci-general.md | Provider-neutral iOS CI guidance, including archive-path and fresh-clone checks |
| references/ios-ci-github-actions.md | GitHub Actions specifics and runner drift checks |
| references/ios-ci-optimization.md | Compatibility index for the CI reference split |
| references/ios-version-and-vision-pro.md | iOS 26 Liquid Glass snapshot impact, iOS 18 predictive back and Apple Intelligence testing, visionOS 26 destination syntax, Reality Composer Pro asset testing, hand-tracking simulator limits |
| ../qa-testing-mobile/references/localization-testing.md | Layered localization coverage for mobile UI and backend-served content |
| ../qa-testing-accessibility/SKILL.md | Accessibility-specific QA gates, screen-reader coverage, and conformance boundary guidance |
| data/sources.json | Curated external references |
| Script | Purpose |
|---|---|
| scripts/xcresult_to_junit.py | Convert .xcresult bundle to JUnit XML for CI publishing (Xcode 16+, stdlib only) |
| scripts/README.md | Usage guide and CI integration examples (GitHub Actions, Bitrise) |
| Template | Purpose |
|---|---|
| assets/template-ios-ui-test-stability-checklist.md | Review checklist for UI-test determinism |
iOS testing request
-> Classify layer: Swift Testing, XCTest, XCUITest, snapshot, or release smoke
-> Pick exact scheme, destination, simulator/device, OS, and runner mode
-> Stabilize fixtures, accessibility identifiers, permissions, and time/locale
-> Run the smallest targeted test or xcresult-producing command
-> Parse artifacts, screenshots, logs, and xcresult failures
-> Widen to CI, matrix, or release gate only after targeted evidence is green
## Workflow, ## xcodebuild Patterns, and ## Flake Control for the baseline sequence## Resources and ## Templates for deeper materials## Related Skills for mobile QA and native-platform handoffs| Skill | Purpose |
|---|---|
| software-ios-native | Native iOS implementation, rewrites, and Xcode agent workflows |
| software-ios-runtime-debugging | Build/install/launch proof and stale-build triage before test interpretation |
| software-mobile | Platform choice and broader mobile guidance |
| qa-testing-strategy | Risk-based test strategy |
| qa-testing-mobile | Cross-platform mobile QA |
Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
Frequently asked questions
High-signal iOS test execution and flake control for XCTest, XCUITest, Swift Testing, xcodebuild, xcresult, and simctl.
The source record exposes this install command: npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/qa-testing-ios". Inspect the command and pinned source before running it.
The pinned source record declares support for: codex, claude code.
Static rules flagged read-files, network in the source; the page lists the matching lines and excerpts.
Alternatives
upex-galaxy/agentic-qa-boilerplate
Orchestrates in-sprint manual QA per ticket across Stages 1 (Planning), 2 (Execution) and 3 (Reporting). Use for user-story testing, bug retesting, and batch-sprint QA loops. Creates the PBI folder, drives session-start, runs the triage + veto + risk-score decision tree on bugs, produces the ATP + ATR + TC artifacts in the TMS, executes smoke and trifuerza (UI/API/DB) exploration, and files the final QA comment + bug reports. Triggers on: test this ticket, QA this user story, retest this bug, ve
vasilyu1983/AI-Agents-public
Designs Android testing with Espresso, UI Automator, and Compose. Use when planning device matrices, screenshot tests, CI flows, or flake-control workflows.
upex-galaxy/agentic-qa-boilerplate
Walks new users through this repo's QA flow — Playwright + KATA + Allure + Xray stack, Jira QA workflow (Backlog → Shift-Left QA → Estimation → Ready For Dev → Ready For QA → In Test → QA Approved → Ready For Release → Deployed to Production), /shift-left-testing for pre-sprint AC refinement on backlog Stories, /sprint-testing for in-sprint manual QA, /test-documentation for TMS test cases, /test-automation for KATA-compliant E2E/API tests, /regression-testing for CI suite execution, /framework-
openai/skills
Build, scaffold, refactor, and troubleshoot ChatGPT Apps SDK applications that combine an MCP server and widget UI. Use when Codex needs to design tools, register UI resources, wire the MCP Apps bridge or ChatGPT compatibility APIs, apply Apps SDK metadata or CSP or domain settings, or produce a docs-aligned project scaffold. Prefer a docs-first workflow by invoking the openai-docs skill or OpenAI developer docs MCP tools before generating code.