Summary
Define structured, JSON-serializable result types for all Apple environment and simulator management APIs. This supports the --json global option from the CLI spec.
Requirements
Every API should return a typed result that can be serialized to JSON. The output contract should include:
Standard envelope
All JSON output follows a consistent structure:
{ "type": "result", "command": "apple.check", "data": { ... } }
{ "type": "progress", "message": "Downloading iOS 18.2 runtime...", "percent": 45 }
{ "type": "error", "code": "XCODE_NOT_FOUND", "message": "..." }
Model types needed
XcodeInfo — version, path, build number, bundled SDKs, isSelected
SimulatorInfo — name, UDID, state, runtime, deviceType
RuntimeInfo — platform, version, build, identifier, size, source
EnvironmentCheckResult — xcode, clt, runtimes, platforms, overall status
ProgressReport — message, percent, step
ErrorResult — code, message, details
Design Notes
- Use
System.Text.Json source generators for AOT-friendly serialization
- Follow the naming conventions from the CLI spec (camelCase JSON properties)
- These models are the contract between the library and the CLI — keep them stable
- Consider placing in a separate namespace (e.g.,
Xamarin.MacDev.Models) for clean separation
Reference
Summary
Define structured, JSON-serializable result types for all Apple environment and simulator management APIs. This supports the
--jsonglobal option from the CLI spec.Requirements
Every API should return a typed result that can be serialized to JSON. The output contract should include:
Standard envelope
All JSON output follows a consistent structure:
{ "type": "result", "command": "apple.check", "data": { ... } } { "type": "progress", "message": "Downloading iOS 18.2 runtime...", "percent": 45 } { "type": "error", "code": "XCODE_NOT_FOUND", "message": "..." }Model types needed
XcodeInfo— version, path, build number, bundled SDKs, isSelectedSimulatorInfo— name, UDID, state, runtime, deviceTypeRuntimeInfo— platform, version, build, identifier, size, sourceEnvironmentCheckResult— xcode, clt, runtimes, platforms, overall statusProgressReport— message, percent, stepErrorResult— code, message, detailsDesign Notes
System.Text.Jsonsource generators for AOT-friendly serializationXamarin.MacDev.Models) for clean separationReference