Skip to content

[spec] Add spec for maui devtools#33865

Open
rmarinho wants to merge 34 commits intomainfrom
maui-devtools-spec
Open

[spec] Add spec for maui devtools#33865
rmarinho wants to merge 34 commits intomainfrom
maui-devtools-spec

Conversation

@rmarinho
Copy link
Copy Markdown
Member

@rmarinho rmarinho commented Feb 3, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

MAUI Dev Tools Client -- Product Specification

This PR adds the product specification for maui -- a unified CLI tool for environment setup, device management, and AI agent integration across all MAUI platforms.

Problem

Setting up a MAUI development environment is one of the biggest friction points:

  • Fragmented native tools (sdkmanager, avdmanager, xcrun simctl, xcode-select) with different UX patterns
  • Silent failures that surface as cryptic MSBuild errors
  • No single "doctor" command like Flutter has
  • IDEs (VS and VS Code) independently implement detection/installation logic
  • AI agents have no structured API to query or fix environment state

Solution: maui CLI

A new CLI tool that provides environment health checks, automated fixes, and device management -- designed for three consumers in priority order: AI Agents > CI/CD > Humans.

Design Principles

  1. Delegate to Native Toolchains -- Wraps sdkmanager, xcrun simctl, etc. No custom download/install logic
  2. Reuse & Consolidate -- Leverages dotnet/android-tools for SDK/JDK discovery. Moves proven code from android-platform-support (internal) to the public android-tools package.
  3. Stateless Architecture -- Each command reads state, acts, and exits
  4. Machine-First Output -- Every command supports --json with stable schema; --dry-run, --ci for automation

Command Surface

Cross-Platform

Command Description
maui doctor Check environment health
maui doctor --fix Auto-fix all detected issues
maui doctor --platform <p> Filter by: dotnet, android, apple, windows
maui device list List all devices (physical + emulators + simulators)
maui device list --platform <p> Filter by platform
maui device screenshot --device <id> Capture screenshot from device/simulator
maui device logs --device <id> Stream logs from device
maui --version Display version information

Android

Command Description
maui android install Set up full Android environment (JDK + SDK)
maui android install --accept-licenses Non-interactive install
maui android install --packages <list> Install specific packages
maui android jdk check Check JDK installation status
maui android jdk install Install OpenJDK (default: 17)
maui android jdk list List installed JDK versions
maui android sdk list List installed SDK packages
maui android sdk list --available Show available packages
maui android sdk install <packages> Install SDK package(s)
maui android sdk accept-licenses Accept all SDK licenses
maui android sdk uninstall <package> Uninstall SDK package
maui android emulator list List emulators
maui android emulator create <name> Create emulator
maui android emulator start <name> Start emulator
maui android emulator stop <name> Stop emulator
maui android emulator delete <name> Delete emulator

Apple (macOS only)

Command Description
maui apple install Set up Apple development environment
maui apple install --accept-licenses Also accept Xcode license
maui apple install --runtime <version> Also install specific iOS runtime
maui apple simulator list List simulators
maui apple simulator create <name> <type> <runtime> Create simulator
maui apple simulator start <id> Start simulator
maui apple simulator stop <id> Stop simulator
maui apple simulator delete <id> Delete simulator
maui apple runtime check Check runtime installation status
maui apple runtime list List installed runtimes
maui apple runtime list --available List runtimes available for download
maui apple runtime list --all List all runtimes (installed + available)
maui apple runtime install <version> Install an iOS runtime
maui apple xcode check Check Xcode installation and license status
maui apple xcode list List Xcode installations
maui apple xcode select <path> Switch active Xcode
maui apple xcode accept-licenses Accept Xcode license agreement

Windows (Windows only)

Command Description
maui windows sdk list List Windows SDK installations
maui windows developer-mode status Check Developer Mode status
maui windows developer-mode enable Guide to enable Developer Mode

Global Options

All commands support: --json, --verbose, --ci, --dry-run

Key Features

  • One-command Android bootstrap: maui android install --accept-licenses installs JDK 17, Android SDK, and recommended packages
  • Apple environment setup: maui apple install --accept-licenses --runtime 18.5 verifies Xcode, accepts license, installs runtime
  • Structured error contract: Every error includes code, category, remediation type, and fix command -- designed for AI agent consumption
  • Unified permission model: OS elevation and AI agent permission gates documented per command
  • Copilot escalation: When auto-fix fails, structured diagnostic context is handed off to Copilot for AI-assisted troubleshooting

Goals

Goal Metric
Reduce setup time <10 min for 90% of users
Auto-fix rate >80% of detected issues
API coverage JSON output for all operations
Consolidate repos Replace existing VS acquisition repos

Shared Libraries & Code Reuse

DevTools reuses existing Android tooling rather than building from scratch:

Library Source What We Reuse
Xamarin.Android.Tools.AndroidSdk dotnet/android-tools (public NuGet) SDK/JDK path discovery, validation, version mapping

Contributing to dotnet/android-tools

As part of this work, we are moving proven implementations from android-platform-support (internal) into the public dotnet/android-tools package. This benefits both the maui CLI and the broader .NET Android toolchain -- any tool or IDE that references Xamarin.Android.Tools.AndroidSdk gets these capabilities for free.

Feature android-tools Issue Description
Manifest feed parsing #273 Parse Xamarin/Google manifests for download URLs and SHA-1 checksums
JDK installation #270 Download, verify, and extract Microsoft OpenJDK
SDK bootstrap & management #271 Bootstrap command-line tools, wrap sdkmanager for package operations
License acceptance #272 Programmatic SDK license acceptance for CI/unattended scenarios

No hardcoded download URLs -- all SDK/JDK URLs and SHA-1 checksums come from the Xamarin Android Manifest Feed and Google's repository. Every download is checksum-verified before installation.

Spec Documents

Document Description
maui-devtools-spec.md Main specification (architecture, commands, schemas, error contract)
maui-devtools-ide-integration.md VS Code and Visual Studio UI flows, status panels, fix dialogs

MVP Status

Most P0 features are implemented. VS Code extension integration is in progress. See Section 10 of the main spec for the full MVP vs vNext breakdown.

@rmarinho rmarinho marked this pull request as ready for review February 4, 2026 17:04
Copilot AI review requested due to automatic review settings February 4, 2026 17:04
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.

Copilot wasn't able to review any files in this pull request.

@rmarinho
Copy link
Copy Markdown
Member Author

rmarinho commented Feb 4, 2026

@copilot why can t you review these files?

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 4, 2026

@rmarinho I've opened a new pull request, #33893, to work on those changes. Once the pull request is ready, I'll request review from you.

- Add MauiDevice JSON schema with all fields (platforms[], idiom, runtime_identifiers, etc.)
- Add SdkPackage JSON schema with is_installed flag
- Update sdk list command: --available and --all flags (replaces list-available)
- Update avd commands: stop, delete; --package optional with auto-detection
- Update bootstrap: --packages flag for comma-separated package list
- Add progress reporting documentation with JSON format
- Add shell quoting implementation notes for semicolon handling
- Update jdk commands: check, list (consistent naming)
- Bump version to 2.7-draft
## Summary

Syncs the DevTools spec with the current CLI implementation on
`maui-client-tool` branch.

### What changed

**New commands documented:**
- `apple xcode list` — List installed Xcode versions with version, build
number, selected status
- `apple xcode select <path>` — Switch active Xcode installation
- `android sdk accept-licenses` — Accept SDK licenses
- `android avd stop/delete` — Stop and delete AVDs
- `android bootstrap/jdk` commands in capabilities model

**Schema updates:**
- `MauiDevice`: Added `type`, `state`, `details` fields
- `MauiDevice`: Documented Android-specific field semantics (identifier
= AVD name for emulators, version = API level, version_name = OS version
without prefix, platform_architecture = raw ABI)
- New `XcodeInstallation` schema (path, developer_dir, version, build,
is_selected)

**Spec corrections to match implementation:**
- `doctor --platform` → `doctor --category` (matching actual CLI flag)
- Simulator boot/shutdown/delete use positional `<udid>` not `--udid`
option
- Global options: marked `--non-interactive`, `--correlation-id`,
`--offline` as vNext (not yet implemented)
- FR-X13/X14: Updated from vague 'handle multiple Xcode versions' to
specific `xcode list`/`xcode select` commands (P0)

**MVP tracking:**
- Added status column to MVP table showing which features are
implemented
- Moved `deploy`, `config`, `diagnostic-bundle`, `telemetry` to vNext
(not yet implemented)

Version bumped to 2.8-draft.
Comment on lines +802 to +806
│ └── logs # Stream logs from device (unified across platforms)
│ ├── --device <id> # Device identifier (required)
│ ├── --filter <expr> # Filter expression (platform-specific)
│ ├── --maui-only # Filter to MAUI-related logs only
│ └── --since <time> # Show logs since timestamp
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dotnet run shows live logs now, I would drop this for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

what if i want logs without using dotnet run, like the app is installed and i have the simulator running, and i want to just the device logs to look what happens when i open my app or other app.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right now, VS and VSCOde have this feature of getting device logs, we want to combine this.
Is there other way to get the logs using the android workload without dotnet run? is there a target for that ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there are two different things:

  1. Get the output (stdout/stderr) from the app. This is what dotnet run shows.
  2. Get the device log (on iOS this is stdout/stderr/NSLog from any app). This is what the IDE shows, and IMHO this is also valuable, so I'd keep it.

│ │ ├── --platform # Filter by platform
│ │ └── --json # Output as JSON
│ ├── screenshot # Capture screenshot
│ │ ├── --device <id> # Target device
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One note on what I imagined for this:

  • Some amount of code is shared with dotnet/sdk -- the target framework and device selection, which uses in-memory MSBuild APIs
  • If you have a .csproj in the current directory, it calls the same workflow as dotnet run for selecting a framework and device.

It would be cool to mention this in here, if you left --device blank, as the default behavior.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

can this be shared on android-tools ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you mean shared with dotnet/sdk? That is where the code is today.

I don't think they'll want the dotnet/sdk to start using dotnet/android-tools.

rmarinho added a commit that referenced this pull request Feb 9, 2026
Per PR #33865 feedback:
- Rename 'android bootstrap' to 'android install' throughout spec
- Remove deploy command (covered by 'dotnet run'/'dotnet build -t:Install')
- Remove config command (not needed for MVP)
- Remove diagnostic-bundle section (deferred to vNext)
- Remove telemetry section (deferred to vNext)
- Rename §9 from 'Telemetry & Diagnostics' to 'Diagnostics'
- Remove APK install and logcat from command tree (covered by 'dotnet run')
- Clean up vNext list
Per PR #33865 feedback:
- Rename 'android bootstrap' to 'android install' throughout spec
- Remove deploy command (covered by 'dotnet run'/'dotnet build -t:Install')
- Remove config command (not needed for MVP)
- Remove diagnostic-bundle section (deferred to vNext)
- Remove telemetry section (deferred to vNext)
- Rename §9 from 'Telemetry & Diagnostics' to 'Diagnostics'
- Remove APK install and logcat from command tree (covered by 'dotnet run')
- Clean up vNext list
rmarinho added a commit that referenced this pull request Feb 10, 2026
Per PR #33865 feedback from @jonathanpeppers:
- Rename 'android bootstrap' to 'android install' (analogous to 'dotnet workload install')
- Remove 'deploy' command (covered by 'dotnet run' and 'dotnet build -t:Install')
- Update all user-facing strings, method names, and tests
@rmarinho rmarinho added the t/enhancement ☀️ New feature or request label Feb 10, 2026
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.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.

| `maui apple xcode select` | — | ✓ | Yes (sudo) | `environment.modify` |
| `maui apple xcode accept-licenses` | — | ✓ | Yes (sudo) | `environment.modify` |

*OS Elevation required for: installing Android SDK/JDK to system locations (e.g., `Program Files`), installing Xcode runtimes, switching Xcode, accepting Xcode licenses
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The table shows "Sometimes*" for OS Elevation on several install operations, with a footnote explaining it's required when installing to system locations. However, the footnote doesn't mention that on macOS, installing to user home directories (the default paths shown in the table at lines 252-256) does NOT require elevation. The current wording "installing Android SDK/JDK to system locations" could be misinterpreted. Consider clarifying the footnote to explicitly state: "Required only when installing to system-protected paths (e.g., Program Files on Windows, /opt on macOS). Default user-home installations do not require elevation."

Suggested change
*OS Elevation required for: installing Android SDK/JDK to system locations (e.g., `Program Files`), installing Xcode runtimes, switching Xcode, accepting Xcode licenses
*OS Elevation required only when installing to system-protected paths (e.g., `Program Files` on Windows, `/opt` on macOS) or performing privileged Apple operations (installing Xcode runtimes, switching Xcode, accepting Xcode licenses). Default user-home installations of the Android SDK/JDK do not require elevation.

Copilot uses AI. Check for mistakes.
Comment on lines +154 to +174
**"Ask Copilot for Help" Flow**:

1. User clicks button or types `/maui-help` in Copilot Chat
2. Extension sends diagnostic context to Copilot
3. Copilot receives structured data + conversation prompt:

```
The MAUI Dev Tools detected an issue it couldn't fix automatically.

**Issue**: Android SDK installation failed (E4001 - Connection reset)
**Environment**: macOS 15.0, corporate network with proxy
**Attempted**: 3 download retries, cache clear

The diagnostic bundle is attached. Please help the user resolve this issue.
Common causes for this error include proxy configuration, firewall rules,
or SSL inspection. Ask clarifying questions if needed.
```

4. Copilot engages in conversational troubleshooting
5. Copilot can suggest manual steps or request tool actions with user approval

Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The "Ask Copilot for Help" flow shows a diagnostic context being sent to Copilot with the issue details, but there's no corresponding security or privacy consideration mentioned. The main spec document has section 5.5 on Privacy (NFR-PR1, NFR-PR2, NFR-PR3) requiring PII redaction and file path sanitization. This IDE integration flow should reference those requirements or explicitly state that diagnostic context sent to Copilot must follow the redaction rules defined in the main spec section 5.5 and 9.1.

Copilot uses AI. Check for mistakes.
- Integrates with Visual Studio's environment detection UI
- Surfaces issues in Error List window
- Provides menu items in Tools > MAUI submenu
- Can consume the Android/iOS provider packages directly (as a library) or invoke the `maui` CLI -- either way, the business logic is shared. This avoids duplicating environment detection and fix logic between VS and the CLI.
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The Visual Studio Extension section states that it "Can consume the Android/iOS provider packages directly (as a library) or invoke the maui CLI". However, this dual-mode approach isn't reflected in the main spec's architecture section 6.2 or the Platform Providers description at line 616. If the providers are designed to be consumable as libraries (not just CLI wrappers), this should be documented in the main spec architecture section, including any API surface area, versioning strategy, and compatibility guarantees for library consumers.

Suggested change
- Can consume the Android/iOS provider packages directly (as a library) or invoke the `maui` CLI -- either way, the business logic is shared. This avoids duplicating environment detection and fix logic between VS and the CLI.
- Invokes the `maui` CLI for environment detection and fixes; the CLI, in turn, uses the shared Android/iOS platform provider packages defined in the main MAUI Dev Tools specification. This ensures Visual Studio and the CLI share the same environment detection and fix logic without duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +762 to +768

| Capability | Source in `android-platform-support` | Benefit |
|-----------|--------------------------------------|---------|
| **JDK installation** | `JavaDependencyInstaller` | IDEs, build tasks, and DevTools can auto-install missing JDKs instead of just reporting errors. |
| **SDK bootstrap & management** | `AndroidSDKInstaller` | Shared API for downloading command-line tools and managing SDK packages — used by DevTools CLI, IDE extensions, and CI. |
| **License acceptance** | `AndroidLicensesStorage` | Unattended CI scenarios across all .NET Android tooling. |

Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The PR description references issues #273, #271, and #272 in the context of contributing to dotnet/android-tools. However, the mentioned issues in the PR metadata are actually unrelated old MAUI repository issues about web support, README formatting, and screenshots. The PR description table shows these as android-tools issue numbers but they don't match. Consider verifying these issue numbers and updating the table to link to the correct dotnet/android-tools issues, or removing the issue references if those issues haven't been created yet.

Copilot uses AI. Check for mistakes.
Comment on lines +275 to +276
# With specific packages (comma-separated)
maui android install --packages "platform-tools,build-tools;35.0.0,platforms;android-35"
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The example shows --packages flag but inconsistently describes the package parameter. Line 276 shows the flag with comma-separated packages in quotes, but this conflicts with the command description at line 943 which shows --packages <list> as a single argument. The shell quoting section (lines 423-430) emphasizes avoiding shell interpretation, but this example requires shell interpretation of the comma separator. Consider clarifying whether packages should be space-separated (passed as multiple arguments) or comma-separated (single argument requiring parsing).

Suggested change
# With specific packages (comma-separated)
maui android install --packages "platform-tools,build-tools;35.0.0,platforms;android-35"
# With specific packages (space-separated list)
maui android install --packages platform-tools "build-tools;35.0.0" "platforms;android-35"

Copilot uses AI. Check for mistakes.
Comment on lines +822 to +835
#### Error Code Registry (Partial)

| Code | Category | Message | Remediation Type |
|------|----------|---------|------------------|
| `E1001` | tool | Internal error | terminal |
| `E2001` | platform | SDK licenses not accepted | auto_fixable |
| `E2002` | platform | sdkmanager not found | auto_fixable (install) |
| `E2003` | platform | xcrun failed | user_action |
| `E2004` | platform | Emulator acceleration unavailable | user_action |
| `E3001` | user | Xcode not installed | user_action |
| `E3002` | user | Developer Mode not enabled | user_action |
| `E3003` | user | Insufficient disk space | user_action |
| `E3004` | user | Network unavailable | user_action |

Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The error category definition includes 'unknown' with prefix E0xxx, but the Error Code Registry table only shows E0000. Consider adding at least one or two more example codes in the E0xxx range to illustrate different types of unknown errors (e.g., E0001 for truncated output, E0002 for unrecognized error patterns) to help implementers understand the category better.

Copilot uses AI. Check for mistakes.
Comment on lines +425 to +430
- When calling `avdmanager` or `sdkmanager`, arguments with semicolons **SHOULD** be passed directly to the child process as an argument list (not via a shell) so that semicolons are not interpreted as command separators.
- If shell invocation is unavoidable, quoting **MUST** be documented per shell:
- POSIX shells (`bash`, `zsh`): `--package 'system-images;android-35;google_apis;arm64-v8a'`
- Windows `cmd.exe`: `--package "system-images;android-35;google_apis;arm64-v8a"`
- PowerShell: `--package 'system-images;android-35;google_apis;arm64-v8a'`
- Correct quoting prevents shell interpretation of semicolons as command separators.
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The shell quoting section states that package identifiers "SHOULD" be passed directly as an argument list to avoid shell interpretation. However, this conflicts with the design principle of using native tools. When calling avdmanager or sdkmanager, these are typically shell scripts (.bat on Windows, shell scripts on Unix), not native executables, which means shell invocation may be unavoidable. Consider strengthening this to "MUST pass as argument list when using ProcessStartInfo" and providing specific guidance for cases where shell invocation is truly unavoidable.

Suggested change
- When calling `avdmanager` or `sdkmanager`, arguments with semicolons **SHOULD** be passed directly to the child process as an argument list (not via a shell) so that semicolons are not interpreted as command separators.
- If shell invocation is unavoidable, quoting **MUST** be documented per shell:
- POSIX shells (`bash`, `zsh`): `--package 'system-images;android-35;google_apis;arm64-v8a'`
- Windows `cmd.exe`: `--package "system-images;android-35;google_apis;arm64-v8a"`
- PowerShell: `--package 'system-images;android-35;google_apis;arm64-v8a'`
- Correct quoting prevents shell interpretation of semicolons as command separators.
- When calling `avdmanager` or `sdkmanager` via `ProcessStartInfo` (or an equivalent API), arguments with semicolons **MUST** be passed directly to the child process as an argument list (not via an intermediate shell) so that semicolons are not interpreted as command separators.
- If shell invocation is truly unavoidable (for example, due to platform behavior when invoking `.bat` or shell wrapper scripts where a shell cannot be bypassed), quoting **MUST** be documented per shell:
- POSIX shells (`bash`, `zsh`): `--package 'system-images;android-35;google_apis;arm64-v8a'`
- Windows `cmd.exe`: `--package "system-images;android-35;google_apis;arm64-v8a"`
- PowerShell: `--package 'system-images;android-35;google_apis;arm64-v8a'`
- Correct quoting prevents shell interpretation of semicolons as command separators in those unavoidable shell cases.

Copilot uses AI. Check for mistakes.
| `doctor --fix` | ✓ | ✓ | Sometimes* | `environment.modify` |
| `maui device list` | ✓ | ✓ | No | None |
| `maui device screenshot` | ✓ | ✓ | No | `device.capture` |
| `maui device logs` | ✓ | ✓ | No | `device.logs` |
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The Capabilities Model table shows that maui device logs requires the device.logs AI Agent Permission with "Prompt" as default. However, the command hierarchy at line 934 and the functional requirement FR-A10 at line 156 don't mention any security sensitivity for log streaming. Device logs can contain sensitive user data, PII, and security tokens, so this permission gate is appropriate. Consider adding a note in the Functional Requirements section (FR-A10 or FR-X10) that log streaming requires user consent when invoked by AI agents due to potential sensitive data exposure.

Copilot uses AI. Check for mistakes.
Comment on lines +971 to +972
│ ├── stop # Stop emulator
│ │ └── <name> # Emulator name
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The command description shows <name> as a positional argument, but the table at line 1114 and the command hierarchy at line 972 show it should be an emulator name. However, the error at line 971 says "Stop emulator" with <name> which is inconsistent with how physical devices are stopped (they use device serials). The doc should clarify whether this stops by emulator name (AVD name) or by adb serial when the emulator is running.

Suggested change
│ ├── stop # Stop emulator
│ │ └── <name> # Emulator name
│ ├── stop # Stop emulator by name (AVD)
│ │ └── --name # Emulator name (AVD)

Copilot uses AI. Check for mistakes.
Comment on lines +1167 to +1168
| `version` | string? | API level for Android (e.g., `"35"`), OS version for iOS (e.g., `"18.5"`) |
| `version_name` | string? | OS version number without platform prefix (e.g., `"15.0"` not `"Android 15.0"`) |
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The MauiDevice schema field version_name is described as "OS version number without platform prefix (e.g., '15.0' not 'Android 15.0')", but the example at line 1144 shows "version_name": "18.5" for iOS which matches version at line 1143. This suggests version_name might be redundant. The Android-specific semantics table at lines 1186-1192 clarifies that version_name comes from ro.build.version.release, but for iOS the distinction between version and version_name is unclear. Consider clarifying the purpose of both fields or merging them if they're always identical for iOS.

Suggested change
| `version` | string? | API level for Android (e.g., `"35"`), OS version for iOS (e.g., `"18.5"`) |
| `version_name` | string? | OS version number without platform prefix (e.g., `"15.0"` not `"Android 15.0"`) |
| `version` | string? | API level for Android (e.g., `"35"`), OS version for iOS/macOS (e.g., `"18.5"`) |
| `version_name` | string? | Human-readable OS version string. On Android this is `ro.build.version.release` (e.g., `"15.0"`) and may differ from `version` (API level); on iOS/macOS it currently matches `version`. |

Copilot uses AI. Check for mistakes.
rmarinho added a commit that referenced this pull request Feb 24, 2026
Adds a focused command reference for the maui CLI covering Android,
Apple/iOS commands, and --version. References PR #33865 for the full
specification (architecture, error contracts, IDE integration, schemas).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…CLI)

Adopts the same interactivity pattern as dotnet/sdk: --interactive
defaults to true for terminals, false when CI env vars are detected
(TF_BUILD, GITHUB_ACTIONS, CI, etc.) or Console.IsOutputRedirected.

References dotnet/sdk CommonOptions.CreateInteractiveOption implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho and others added 3 commits February 25, 2026 11:39
Aligns platform filter values with .NET MAUI TFMs across doctor,
device list, and all --platform references. Adds platform values
reference table with host availability. Removes 'dotnet' and 'apple'
as platform values in favor of the TFM-aligned names.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Xcode can't be installed programmatically; 'install' was misleading
- 'apple check' verifies Xcode, runtimes, and environment status
- Singular 'accept-license' matches xcodebuild -license accept
- Android SDK keeps plural 'accept-licenses' (multiple SDK licenses)
- Updated command tree, usage examples, command table, permissions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- apple install: optionally accepts Xcode license and installs runtimes
- apple check: read-only environment status (no modifications)
- Could prompt user to install Xcode in the future
- Singular accept-license for Apple (matches xcodebuild -license accept)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 25, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 25, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 25, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 25, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 26, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 26, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 26, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 26, 2026
Extends docs/design/cli.md with environment setup commands for Android
(SDK/JDK/emulator) and Apple (Xcode/simulator/runtime), global options
(--json, --interactive, --dry-run), platform filter values, and
implementation references to dotnet/android-tools.

Full specification: PR #33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Feb 26, 2026
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Summary

Adds a concise command reference for the `maui` CLI — focused on
**Android**, **Apple/iOS**, and `--version`. This is a quick-review
companion to the full specification in [PR
#33865](#33865).

### What this covers

- `maui --version`
- All `maui android` subcommands (install, jdk, sdk, emulator)
- All `maui apple` subcommands (install, check, xcode, simulator,
runtime)
- Global options (`--json`, `--verbose`, `--interactive`, `--dry-run`)

### Key design points

- **Delegate to native toolchains** — wraps `sdkmanager`, `adb`, `xcrun
simctl`, etc.
- **Reuse shared libraries** — leverages
[`dotnet/android-tools`](https://github.com/dotnet/android-tools) for
SDK/JDK discovery and installation
- **Machine-first output** — every command supports `--json`
- **Interactive detection** — follows `dotnet` CLI pattern (auto-detects
CI via env vars, checks `Console.IsOutputRedirected`)

### What this intentionally omits

- Device listing (covered by `dotnet run --list-devices`)
- Install path defaults (handled by `dotnet/android-tools`)
- Windows commands (see full spec)
- Architecture, error contracts, JSON schemas, IDE integration,
elevation model

All omitted details are in the [full specification (PR
#33865)](#33865).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Move device list, screenshot, logs to vNext
- Update IDE integration: VS consumes android-tools NuGet directly
- Remove runtime list --available (can't enumerate downloadable runtimes)
- Replace maui doctor --json IDE reference with specific check commands

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 33865

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 33865"

Tamilarasan-Paranthaman pushed a commit that referenced this pull request Mar 2, 2026
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Summary

Adds a concise command reference for the `maui` CLI — focused on
**Android**, **Apple/iOS**, and `--version`. This is a quick-review
companion to the full specification in [PR
#33865](#33865).

### What this covers

- `maui --version`
- All `maui android` subcommands (install, jdk, sdk, emulator)
- All `maui apple` subcommands (install, check, xcode, simulator,
runtime)
- Global options (`--json`, `--verbose`, `--interactive`, `--dry-run`)

### Key design points

- **Delegate to native toolchains** — wraps `sdkmanager`, `adb`, `xcrun
simctl`, etc.
- **Reuse shared libraries** — leverages
[`dotnet/android-tools`](https://github.com/dotnet/android-tools) for
SDK/JDK discovery and installation
- **Machine-first output** — every command supports `--json`
- **Interactive detection** — follows `dotnet` CLI pattern (auto-detects
CI via env vars, checks `Console.IsOutputRedirected`)

### What this intentionally omits

- Device listing (covered by `dotnet run --list-devices`)
- Install path defaults (handled by `dotnet/android-tools`)
- Windows commands (see full spec)
- Architecture, error contracts, JSON schemas, IDE integration,
elevation model

All omitted details are in the [full specification (PR
#33865)](#33865).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
davidortinau added a commit to dotnet/docs-maui that referenced this pull request Mar 10, 2026
New reference article for the maui CLI tool introduced in .NET 11:
- maui doctor: environment health checks and auto-fix
- maui android install: JDK, SDK, and emulator setup
- maui apple install: Xcode, licenses, and iOS runtime management
- Structured --json output for CI/CD and AI agent integration

Upstream: dotnet/maui#34217, spec PR dotnet/maui#33865

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
rmarinho added a commit that referenced this pull request Mar 16, 2026
Per PR #33865 feedback from @jonathanpeppers:
- Rename 'android bootstrap' to 'android install' (analogous to 'dotnet workload install')
- Remove 'deploy' command (covered by 'dotnet run' and 'dotnet build -t:Install')
- Update all user-facing strings, method names, and tests
@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented Mar 23, 2026

⚠️ Merge Conflict Detected — This PR has merge conflicts with its target branch. Please rebase onto the target branch and resolve the conflicts.

rmarinho added a commit that referenced this pull request Mar 26, 2026
Per PR #33865 feedback from @jonathanpeppers:
- Rename 'android bootstrap' to 'android install' (analogous to 'dotnet workload install')
- Remove 'deploy' command (covered by 'dotnet run' and 'dotnet build -t:Install')
- Update all user-facing strings, method names, and tests
rmarinho added a commit that referenced this pull request Apr 2, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Summary

Adds the `maui device list` command specification to the existing CLI
design document (`docs/design/cli.md`). This command provides unified,
cross-platform device enumeration without requiring a project context.

See [PR #33865](#33865) for the full
DevTools spec.

## What is added

### Command: `maui device list [--platform <p>] [--json]`

Lists connected devices, running emulators, and available simulators
across all platforms in a single call.

### Two approaches analysis

The spec analyzes two discovery approaches and recommends the
project-free one:

| | MSBuild (`dotnet run --list-devices`) | Native CLI (`maui device
list`) |
|---|---|---|
| Project required | Yes | **No** |
| Cross-platform | One TFM at a time | All platforms at once |
| Speed | Slower (MSBuild eval) | Fast (<2s) |
| ID compatibility | Source of truth | Same native IDs |

### Scenarios requiring project-free discovery

1. AI agent bootstrapping (no `.csproj` yet)
2. IDE startup (device picker before project loads)
3. Environment validation ("can I see my phone?")
4. CI pipeline setup (check emulator before build)
5. Multi-project solutions (unified view)
6. Cross-platform overview (all devices at once)

### Recommended approach

`maui device list` uses direct native tool invocation (`adb devices`,
`simctl list`, `devicectl list`). Device IDs are compatible with `dotnet
run --device`, making them complementary:

```
maui device list          →  "What devices exist on this machine?"
dotnet run --list-devices →  "What devices can run this project?"
```

### Other changes

- Added references to `ComputeAvailableDevices` MSBuild targets in
[dotnet/android](https://github.com/dotnet/android) and
[dotnet/macios](https://github.com/dotnet/macios)
- Updated AI agent workflow example to include device discovery step
- Fixed AppleDev.Tools reference (xcdevice → devicectl)

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

t/enhancement ☀️ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants