From apple-docs
Build Swift packages and Xcode projects, run tests, and interpret results.
npx claudepluginhub briannadoubt/claude-marketplace --plugin apple-docsThis skill uses the workspace's default tool permissions.
Build Swift packages and Xcode projects, run tests, and interpret results.
Provides Ktor server patterns for routing DSL, plugins (auth, CORS, serialization), Koin DI, WebSockets, services, and testApplication testing.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Provides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
Build Swift packages and Xcode projects, run tests, and interpret results.
# Build (debug)
swift build
# Build (release)
swift build -c release
# Build specific target
swift build --target MyTarget
# Build with verbose output
swift build -v
# Run all tests
swift test
# Run specific test class
swift test --filter MyTests
# Run specific test method
swift test --filter MyTests/testSomething
# Run with verbose output (see each test)
swift test -v
# Run tests in parallel
swift test --parallel
# Enable coverage
swift test --enable-code-coverage
# Find coverage data
COVERAGE_PATH=$(swift test --enable-code-coverage 2>&1 | grep "llvm-cov" | sed 's/.*export //' | awk '{print $1}')
# View coverage report (requires successful test run first)
xcrun llvm-cov report \
.build/debug/YourPackagePackageTests.xctest/Contents/MacOS/YourPackagePackageTests \
-instr-profile=.build/debug/codecov/default.profdata
# List available schemes
xcodebuild -list
# Build a scheme
xcodebuild -scheme MyScheme -destination 'platform=iOS Simulator,name=iPhone 16' build
# Run tests
xcodebuild -scheme MyScheme -destination 'platform=iOS Simulator,name=iPhone 16' test
# Build for specific SDK
xcodebuild -scheme MyScheme -sdk iphonesimulator build
# Clean build
xcodebuild -scheme MyScheme clean build
# Extract just errors from build output
swift build 2>&1 | grep -E "error:|warning:"
# Get context around errors
swift build 2>&1 | grep -B2 -A2 "error:"
| Pattern | Meaning |
|---|---|
cannot find 'X' in scope | Missing import or typo |
type 'X' has no member 'Y' | Wrong method/property name |
cannot convert value | Type mismatch |
missing argument | Function call missing required param |
ambiguous use of | Multiple matching overloads |
# Run tests and capture output
swift test 2>&1 | tee test-output.txt
# Find failures
grep -E "failed|FAIL" test-output.txt
# Get failure details
grep -B5 -A10 "failed" test-output.txt
Test Case '-[ModuleTests.MyTests testExample]' started.
/path/to/file.swift:42: error: -[ModuleTests.MyTests testExample] : XCTAssertEqual failed: ("1") is not equal to ("2")
Test Case '-[ModuleTests.MyTests testExample]' failed (0.001 seconds).
# Resolve dependencies first
swift package resolve
swift build
# Swift Package
rm -rf .build && swift build
# Xcode
xcodebuild clean && xcodebuild build -scheme MyScheme
swift package update
# Run default executable
swift run
# Run specific product
swift run MyExecutable
# Run with arguments
swift run MyExecutable --arg1 value1
# Run release build
swift run -c release MyExecutable
swift build before swift test to get cleaner error output-v (verbose) when you need to see what's happening--filter to speed up iterationPackage.swift for available targets and productsFor structured output or advanced features:
swift_build - Returns parsed errors/warnings as JSONswift_test - Returns test results with pass/fail countsswift_run - Captures stdout/stderr separately