swift-unit-tests
How to run swift unit tests
When & Why to Use This Skill
This Claude skill provides a streamlined workflow for executing Swift unit tests within an iOS development environment. It automates the technical overhead of identifying available iOS simulators, selecting the most appropriate device (such as the latest iPhone Pro models), and constructing the precise xcodebuild command required to run test suites against specific projects and schemes.
Use Cases
- Local Development Validation: Quickly verify code changes by running unit tests on the latest iOS simulators without manual configuration.
- Continuous Integration Setup: Generate the exact shell commands needed to integrate automated Swift testing into CI/CD pipelines like GitHub Actions or Jenkins.
- Troubleshooting Test Environments: Efficiently list and manage booted simulators to resolve environment-related testing failures in Xcode projects.
| name | swift-unit-tests |
|---|---|
| description | How to run swift unit tests |
- List available simulators with
xcrun simctl list devices available - If one is booted already, use that. Prefer iPhone xx Pros, the latest ones
- Run the unit tests with
xcodebuild test -project YourApp.xcodeproj -scheme YourScheme -destination 'platform=iOS Simulator,name=iPhone 17 Pro'. The app is usually in the root of the directory. The simulator is the one from step 2. The scheme has to be found out