Skip to content

Add Apple platform commands to CLI#56

Open
rmarinho wants to merge 2 commits intomainfrom
add-apple-cli
Open

Add Apple platform commands to CLI#56
rmarinho wants to merge 2 commits intomainfrom
add-apple-cli

Conversation

@rmarinho
Copy link
Copy Markdown
Member

@rmarinho rmarinho commented Apr 2, 2026

Summary

Add Apple CLI commands backed by the Xamarin.Apple.Tools.MaciOS NuGet package from dotnet/macios-devtools.

New Commands

Command Description
maui apple xcode list List installed Xcode installations
maui apple runtime list [--platform] List simulator runtimes
maui apple simulator list List simulator devices
maui apple simulator start <name-or-udid> Boot a simulator
maui apple simulator stop <name-or-udid> Shut down a simulator
maui apple simulator delete <name-or-udid> Delete a simulator

Implementation

  • IAppleProvider / AppleProvider — Interface and implementation using Xamarin.MacDev APIs (XcodeManager, SimulatorService, RuntimeService, CommandLineTools)
  • AppleCommands — CLI command group with JSON output support and Spectre.Console table formatting
  • DoctorService — Added Apple health checks (Xcode, CLT, iOS runtimes) and apple category
  • DeviceManager — Apple simulator devices included in maui device list
  • ErrorCodes — Added E22xx Apple error codes
  • FakeAppleProvider — Test fake with configurable return values and call tracking

Dependency

Added Xamarin.Apple.Tools.MaciOS 1.0.0-preview.1.26201.1 as a maestro dependency from the dotnet10 feed.

Tests

  • 9 new tests added (Apple provider, doctor, device manager)
  • All 127 tests pass

Add Apple CLI commands (xcode, runtime, simulator management) backed by
the Xamarin.Apple.Tools.MaciOS NuGet package from macios-devtools.

New commands:
- maui apple xcode list — List installed Xcode installations
- maui apple runtime list [--platform] — List simulator runtimes
- maui apple simulator list — List simulator devices
- maui apple simulator start/stop/delete — Manage simulators

Implementation:
- IAppleProvider/AppleProvider using Xamarin.MacDev APIs (XcodeManager,
  SimulatorService, RuntimeService, CommandLineTools)
- Apple health checks in DoctorService (Xcode, CLT, iOS runtimes)
- Apple simulator devices in DeviceManager
- FakeAppleProvider for unit testing
- 9 new tests (127 total, all passing)
- Maestro dependency for Xamarin.Apple.Tools.MaciOS 1.0.0-preview.1.26201.1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 2, 2026 12:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an Apple platform feature set to the MAUI CLI, enabling discovery and basic management of Xcode/simulator tooling via the Xamarin.Apple.Tools.MaciOS-backed provider and wiring it into existing doctor + device flows.

Changes:

  • Introduces maui apple ... command group (xcode/runtime/simulator) with JSON + table output.
  • Adds IAppleProvider/AppleProvider and wires Apple checks into DoctorService and Apple simulators into DeviceManager.
  • Adds Apple tooling dependency/version plumbing plus unit-test fakes and coverage for new behaviors.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Cli/Microsoft.Maui.Cli/Services/DoctorService.cs Adds Apple health checks and apple category support.
src/Cli/Microsoft.Maui.Cli/Services/DeviceManager.cs Includes Apple simulator devices in device aggregation.
src/Cli/Microsoft.Maui.Cli/ServiceConfiguration.cs Registers IAppleProvider and supports test overrides.
src/Cli/Microsoft.Maui.Cli/Providers/Apple/IAppleProvider.cs Defines Apple provider API + DTO records for CLI output.
src/Cli/Microsoft.Maui.Cli/Providers/Apple/AppleProvider.cs Implements Apple tooling operations and doctor checks via Xamarin.MacDev.
src/Cli/Microsoft.Maui.Cli/Program.cs Wires Apple commands and exposes Program.AppleProvider.
src/Cli/Microsoft.Maui.Cli/Microsoft.Maui.Cli.csproj Adds Xamarin.Apple.Tools.MaciOS package reference.
src/Cli/Microsoft.Maui.Cli/Errors/ErrorCodes.cs Adds E22xx Apple-related error codes.
src/Cli/Microsoft.Maui.Cli/Commands/AppleCommands.cs Implements maui apple command tree and formatting.
src/Cli/Microsoft.Maui.Cli.UnitTests/ServiceConfigurationTests.cs Verifies DI registration and override behavior for Apple provider.
src/Cli/Microsoft.Maui.Cli.UnitTests/Fakes/FakeAppleProvider.cs Adds configurable fake Apple provider for tests.
src/Cli/Microsoft.Maui.Cli.UnitTests/DoctorServiceTests.cs Adds tests asserting Apple checks are included.
src/Cli/Microsoft.Maui.Cli.UnitTests/DeviceManagerTests.cs Adds tests asserting Apple simulators flow into device listing/filtering.
eng/Versions.props Adds centrally-managed Apple tools version property.
eng/Version.Details.xml Adds maestro-managed dependency entry for Apple tools.
Directory.Packages.props Pins Apple tools package version via central package management.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rmarinho rmarinho requested a review from rolfbjarne April 2, 2026 13:36
@jfversluis
Copy link
Copy Markdown
Member

Make sure to also update README(s)!

…nc from sync handlers, check platform before resolving provider

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants