run-device-tests

Automate local .NET MAUI device test execution across platforms with category filtering.

23.3k|2.0k|Updated May 8, 2020
One-click install
npx skills add https://github.com/dotnet/maui --skill run-device-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-device-tests
Source: https://github.com/dotnet/maui/tree/main/.github/skills/run-device-tests
Command: npx skills add https://github.com/dotnet/maui --skill run-device-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Start-Emulator.ps1, shared-utils.ps1, and includes scripts (resource) components.

What problem does it solve?

This Skill automates building and running .NET MAUI device tests locally across iOS, MacCatalyst, Android, and Windows with optional test category filtering.

Core Features & Use Cases

  • Cross-platform testing: Build and run device tests on macOS (iOS/MacCatalyst) and Windows (Android/Windows), with optional category filtering to target specific test groups.
  • Targeted workflows: Execute tests for specific MAUI projects (Controls, Core, Essentials, Graphics) and select platforms or versions as needed.
  • Use Case: A developer wants to validate a new MAUI control on iOS and Android without running the entire suite, using a TestFilter to run only category Button tests.

Quick Start

pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Controls -Platform ios pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1 -Project Core -Platform android -TestFilter "Category=Button"

Frequently Asked Questions about run-device-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run .NET MAUI device tests locally on iOS and Android with category filtering?

To run .NET MAUI device tests locally, use the Run-DeviceTests script to specify projects, platforms, and test categories. This automates building and executing tests on iOS, MacCatalyst, Android, and Windows with optional category filtering to target specific test groups.

What do I need installed to execute MAUI device tests on simulators and emulators?

Executing MAUI device tests requires the XHarness CLI, Xcode, Android SDK, and the .NET SDK with platform workloads. These dependencies enable the scripts to orchestrate booting simulators and emulators and invoking tests across macOS and Windows hosts.

Can I target specific MAUI projects like Controls or Core when running device tests?

Yes, you can target specific MAUI projects including Controls, Core, Essentials, and Graphics when running device tests. The script accepts a Project parameter to execute tests for the desired component, select platforms, and versions as needed.

How do I filter MAUI device tests to run only specific test categories like Button tests?

Use the TestFilter parameter to filter MAUI device tests by category, such as passing TestFilter "Category=Button" to run only Button tests. This enables targeted validation without executing the entire test suite across platforms.

Does this MAUI testing approach work on both macOS and Windows hosts?

Yes, this approach supports cross-platform MAUI testing on macOS for iOS and MacCatalyst, and Windows for Android and Windows. The scripts handle platform-specific simulator and emulator booting to streamline validation during development.

What is the best way to validate a new MAUI control on iOS and Android without running the full test suite?

The best way is to use the Run-DeviceTests script with category filtering, specifying the project and platform with a TestFilter. This runs only the targeted test groups, such as Button category tests, across iOS and Android without executing everything.