swift-unit-tests

diegopetrucci's avatarfrom diegopetrucci

How to run swift unit tests

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 31, 2025

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.
nameswift-unit-tests
descriptionHow to run swift unit tests
  1. List available simulators with xcrun simctl list devices available
  2. If one is booted already, use that. Prefer iPhone xx Pros, the latest ones
  3. 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