Skip to content

Add simulator extras: privacy, appearance, status_bar, openurl, push, location, addmedia, screen capture#177

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-simulator-extras
Draft

Add simulator extras: privacy, appearance, status_bar, openurl, push, location, addmedia, screen capture#177
Copilot wants to merge 3 commits intomainfrom
copilot/add-simulator-extras

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

Exposes the remaining xcrun simctl operations through SimulatorService so callers no longer need to shell out directly. Covers all 8 feature groups from the issue.

New API surface

Property/Method simctl subcommand
service.Privacy.Grant/Revoke/Reset(udid, PrivacyPermission.Calendar, bundleId?) privacy <udid> grant|revoke|reset <service>
service.SetAppearance(udid, SimulatorAppearance.Dark) / GetAppearance(udid) ui <udid> appearance
service.StatusBar.Override(udid, new StatusBarOverrides(Time:"09:41", BatteryLevel:80)) / .Clear(udid) status_bar <udid> override|clear
service.OpenUrl(udid, url) openurl <udid> <url>
service.Push(udid, bundleId, jsonOrPath) push <udid> <bundleId> <file>
service.Location.Set(udid, lat, lng) / .Clear(udid) / .Run(udid, gpxPath) location <udid> set|clear|run
service.AddMedia(udid, paths) addmedia <udid> <files…>
service.ScreenCapture.Screenshot(udid, path, ScreenshotFormat.Png) io <udid> screenshot
service.ScreenCapture.StartRecording(udid, path) → IDisposable io <udid> recordVideo

StartRecording returns an IDisposable; disposing it kills the recordVideo process.

Push accepts either a file path or an inline JSON string — when the payload starts with { it is written to a temp file automatically.

New types

  • Enums: PrivacyPermission, SimulatorAppearance, SimulatorBatteryState, SimulatorDataNetwork, ScreenshotFormat, VideoRecordingFormat
  • Record: StatusBarOverrides (all fields optional)
  • Class: RecordingOptions (Format, Force)
  • Service classes: SimulatorPrivacy, SimulatorStatusBar, SimulatorLocation, SimulatorScreenCapture — all constructed lazily via properties on SimulatorService

Infrastructure changes

  • SimulatorService made partial to split feature groups across files.
  • SimCtl.XcrunPath promoted to internal static so SimulatorScreenCapture can reference it when starting a persistent recording process.
  • IsExternalInit polyfill added to NullableAttributes.cs — required for C# 9 record types to compile against the netstandard2.0 target.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/macios-devtools/macios-devtools/Xamarin.MacDev.sln --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • 2kmvsblobprodcus39.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/EAFBC6E33F4372D62A064209AA87BA2F/missingpackages_workingdir --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/46EB19D8E6D150879BD3367A72FC2FBC/missingpackages_workingdir --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • 51yvsblobprodcus36.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build Xamarin.MacDev/Xamarin.MacDev.csproj -nologo -v:minimal (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/macios-devtools/macios-devtools/Xamarin.MacDev.sln --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/macios-devtools/macios-devtools/Xamarin.MacDev/Xamarin.MacDev.csproj --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • 7k6vsblobprodcus337.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build Xamarin.MacDev/Xamarin.MacDev.csproj -nologo -v:minimal (dns block)
  • kmuvsblobprodcus389.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/macios-devtools/macios-devtools/Xamarin.MacDev.sln --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • kxqvsblobprodcus376.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/047D30272EE2B8A118836103AA894C89/missingpackages_workingdir --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • m8dvsblobprodcus37.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/5A662EEFB2568432D6FDBE7CF1D19C8E/missingpackages_workingdir --packages /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-05016c733fb84ab0/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)
  • securitytools.pkgs.visualstudio.com
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add simulator extras for privacy, appearance, and more Add simulator extras: privacy, appearance, status_bar, openurl, push, location, addmedia, screen capture Apr 30, 2026
Copilot AI requested a review from rmarinho April 30, 2026 19:58
Copilot AI and others added 3 commits May 11, 2026 10:48
… push, location, addmedia, screen capture)

Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/249ea126-48c7-436b-b123-232b305a6be3

Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
…ents backslash escaping, specific catch types)

Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/249ea126-48c7-436b-b123-232b305a6be3

Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
…overrides

- Use SIGINT instead of SIGKILL in VideoRecordingSession.Dispose so
  simctl can flush and write the video file trailer (prevents corrupt
  output files). Falls back to Process.Kill if SIGINT fails or times out.
- Drain redirected stdout/stderr with async readers in StartRecording
  to prevent pipe buffer deadlocks on longer recordings.
- Use .json extension for temporary push payload files instead of .tmp
  to satisfy simctl push file extension requirements.
- Guard StatusBarOverrides.Override against all-null overrides that
  would produce an invalid simctl invocation.
- Fix NUnit2009 analyzer errors in ReturnsSameInstance tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rmarinho rmarinho force-pushed the copilot/add-simulator-extras branch from 9f2b890 to 5a3fd2a Compare May 11, 2026 13:00
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.

Add simulator extras: privacy, appearance, status_bar, openurl, push, location, addmedia, screen capture

2 participants