Loading...
Loading...
Run and stabilize iOS tests (XCTest, XCUITest, Swift Testing) on simulators and devices with xcodebuild/simctl: choose destinations, manage simulator state, control flakes (locale/time/network/animations), configure CI, and collect/parse xcresult artifacts.
npx skill4agent add vasilyu1983/ai-agents-public qa-testing-iosxcodebuildsimctl-workspace-project-scheme-testPlanOS=latestxcresult| Task | Command |
|---|---|
| List schemes | |
| List simulators | |
| List devices (USB) | |
| Boot simulator | |
| Wait for boot | |
| Build app | |
| Install app | |
| Run tests | |
| Run tests (device) | |
| Reset simulators | |
| Take screenshot | |
| Record video | |
workspace/projectschemetestPlan-resultBundlePathxcresult-only-testing:TargetTests/ClassName/testMethod-skip-testing:TargetTests/FlakyClass-testPlan <plan>-parallel-testing-enabled YES-maximum-parallel-testing-workers N-resultBundlePath TestResults.xcresultxcodebuild build-for-testing ...xcodebuild test-without-building ...open TestResults.xcresultxcrun xcresulttool get --path TestResults.xcresult --format json-retry-tests-on-failure -test-iterations 2-test-iterations 50 -test-repetition-mode until-failure-only-testing:TargetTests/ClassName/testMethod -test-iterations 20| Layer | Framework | Scope |
|---|---|---|
| Unit | XCTest / Swift Testing | Business logic (fast) |
| Snapshot | XCTest + snapshot libs | View rendering |
| Integration | XCTest | Persistence, networking |
| UI | XCUITest | Critical user journeys |
waitForExistencexcrun simctl privacy booted grant ...name: iOS CI
on: [push, pull_request]
jobs:
test:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "16.0"
- run: |
set -euo pipefail
xcodebuild test \
-scheme MyApp \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=latest' \
-resultBundlePath TestResults.xcresult
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: TestResults.xcresultxcresult| Resource | Purpose |
|---|---|
| references/swift-testing.md | Swift Testing framework |
| references/simulator-commands.md | Complete simctl reference |
| references/xctest-patterns.md | XCTest/XCUITest patterns |
| Template | Purpose |
|---|---|
| assets/template-ios-ui-test-stability-checklist.md | Stability checklist |
| Skill | Purpose |
|---|---|
| software-mobile | iOS development |
| qa-testing-strategy | Test strategy |
| qa-testing-mobile | Cross-platform mobile |