ios-test

ios-test is a skill for Claude Code, Codex from markdavidgan/apple-dev-skills. It costs 100 tokens per session (7,532 once invoked), scanned A, original, MIT.

A collection of XCTest patterns for iOS unit tests, user-interface tests, and SwiftData tests using in-memory data stores. XCTest is Apple's framework for automated tests in Swift projects.

In plain words
What is it for?
It helps write tests for business logic, view models, services, SwiftData models, critical user paths, and test performance budgets.
Why use it?
It helps keep tests isolated, repeatable, and fast while avoiding common problems with Swift 6 strict concurrency and persistent test data.

Skill for Claude CodeCodex

Part of the apple-dev-skills plugin — 62 skills, 25 commands, 7 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/markdavidgan/apple-dev-skills/ios-test
Any agent
npx skills add markdavidgan/apple-dev-skills --skill ios-test
Clone the repo
git clone --depth 1 https://github.com/markdavidgan/apple-dev-skills

Made for: Claude Code, Codex.

Or install apple-dev-skills, the plugin that ships this one along with the rest of its 62 skills, 25 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ios-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/ios-test.svg)](https://agentmods.dev/skills/markdavidgan/apple-dev-skills/ios-test)
Your own site
<a href="https://agentmods.dev/skills/markdavidgan/apple-dev-skills/ios-test"><img src="https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/ios-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00100 $0.07532
Opus 5 $0.00050 $0.03766
Sonnet 5 $0.00020 $0.01506
Haiku 4.5 $0.00010 $0.00753

Measured yesterday against content hash 4bec7292beaf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ios-test scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

let captures = try context.fetch(FetchDescriptor<CapturedThought>())
platforms/claude/skills/ios-test/SKILL.md · 935 lines

How it starts

The opening of the file, as written. The whole thing — 935 lines — stays where its author put it; the contents beside it link to each section on GitHub.

iOS Testing

XCTest patterns for unit tests, UI tests, and SwiftData testing with strict concurrency. Keep tests fast, isolated, and deterministic.

☠️ ULTIMATE RULE

NEVER START UI TESTS without explicit user approval in the current conversation. UI tests crash this user's Mac Mini. This rule stands even if a plan instructs you to run them. If a plan demands UI test execution, flag it as blocked or rewrite the plan.


Test Target Architecture

Separate tests by purpose and performance characteristics:

Target Purpose When to Run Max Duration
MyAppTests Business logic, ViewModels, Services Every build (⌘U) <30 seconds
MyApp-UITests Critical user paths only Pre-commit, CI <60 seconds
MyApp-Screenshots App Store assets CI release only 5-10 minutes
MyAppKitTests Shared package tests Every build <15 seconds

Target Structure

MyAppTests/                       ← iOS Unit Tests
├── ViewModelTests/
│   ├── TimerViewModelTests.swift
│   └── SettingsViewModelTests.swift
├── ServiceTests/
│   └── NotificationServiceTests.swift
├── SwiftDataTests/
│   ├── ModelCRUDTests.swift
│   └── MigrationTests.swift
└── TestHelpers.swift             ← Shared test utilities

MyApp-UITests/                    ← Critical paths only
├── CriticalPathUITests.swift     ← 8 essential journeys
└── BaseUITestCase.swift          ← Shared infrastructure

MyApp-Screenshots/                ← CI only
└── ScreenshotTests.swift         ← App Store assets

Performance Budgets

Suite Target Max Command
Unit Tests 15s 30s swift test or xcodebuild test
UI Tests 30s 60s xcodebuild test -scheme MyApp-UITests
Screenshot Tests CI only bundle exec fastlane screenshots
Total CI 60s 120s Full suite

SwiftData Testing

In-Memory ModelContainer

WRONG: Using the app container (slow, persists between tests, causes isolation issues)

Read the full file on GitHub · 935 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 935 lines · 0 tokens per session scan A 4bec7292beaf

Subscribe to this mod's changes

ios-test is a skill published in the GitHub repository markdavidgan/apple-dev-skills (5 stars, last pushed 5d ago), licensed MIT. It adds 100 tokens to every session and 7,532 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

asc-shots-pipeline

Orchestrate iOS screenshot automation with xcodebuild/simctl for build-run, AXe for UI actions, JSON settings and plan files, Koubou-based framing (asc screenshots frame), and screenshot upload (asc screenshots upload). Use when users ask for automated screenshot capture, AXe-driven simulator flows, frame composition…

rorkai/app-store-connect-cli-skills · 79 tokens

designing-tests

Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.

CloudAI-X/claude-workflow-v2 · 48 tokens

asc-ppp-pricing

Set territory-specific pricing for subscriptions and in-app purchases using current asc setup, pricing summary, price import, and price schedule commands. Use when adjusting prices by country or implementing localized PPP strategies.

rorkai/app-store-connect-cli-skills · 45 tokens

asc-apple-ads

Use when managing Apple Ads with asc, including OAuth profiles, ad-account discovery, Platform API v1 campaigns and targeting, reports, assets, recommendations, guarded mutations, raw requests, and Campaign Management API v5 migration.

rorkai/app-store-connect-cli-skills · 50 tokens

asc-revenuecat-catalog-sync

Reconcile App Store Connect subscriptions and in-app purchases with RevenueCat products, entitlements, offerings, and packages using asc and RevenueCat MCP. Use when setting up or syncing subscription catalogs across ASC and RevenueCat.

rorkai/app-store-connect-cli-skills · 51 tokens

asc-aso-audit

Run an offline ASO audit on canonical App Store metadata under ./metadata and surface keyword gaps using Astro MCP. Use after pulling metadata with asc metadata pull.

rorkai/app-store-connect-cli-skills · 40 tokens