# IOS Unit Test

> Run iOS unit/UI tests, report results, and optionally fix failures. Use when this capability is needed.

- Skill: `tomevault-io/ios-unit-test` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/ios-unit-test`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/ios-unit-test/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/ios-unit-test

---


## Purpose

Run iOS tests, report failures with enough detail to debug, then (with approval) fix issues and re-run to confirm.

## Arguments

- `--scheme <name>` — Xcode scheme (inferred from xcodebuild -list if omitted)
- `--project <path>` — Path to .xcodeproj or .xcworkspace (auto-detected if omitted)
- `--configuration <config>` — Build configuration (default: NonProd)
- `--no-fix` — Report only, don't offer to fix

## Workflow

### 1. Run tests

```bash
xcodebuild \
  -project MyApp.xcodeproj \
  -scheme MyApp \
  -configuration NonProd \
  -destination 'platform=iOS Simulator,name=iPhone 17 Pro' \
  test
```

Use `xcodebuild -list` to discover schemes if not specified. Simulator names vary by Xcode version — use `xcrun simctl list devices available` to find available simulators.

**Note:** Tests use Swift Testing framework (`import Testing`, `@Test`, `#expect`), not XCTest.

### 2. Report results

Include:

- Pass/fail/skip counts
- Each failing test: target, file, test name, assertion/error message
- If test target won't build, include build errors

### 3–4. Approval gate, fix and confirm

See `/shared-review-workflow` for approval gate protocol, fix constraints, and severity definitions. Group iOS failures by area (view model, persistence, notifications, UI).

## Reference

For xcodebuild patterns and common fixes, see `reference/ios-unit-test-reference.md`

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/edfenton) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

