Add simulator extras: privacy, appearance, status_bar, openurl, push, location, addmedia, screen capture#177
Draft
Add simulator extras: privacy, appearance, status_bar, openurl, push, location, addmedia, screen capture#177
Conversation
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
… 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>
9f2b890 to
5a3fd2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exposes the remaining
xcrun simctloperations throughSimulatorServiceso callers no longer need to shell out directly. Covers all 8 feature groups from the issue.New API surface
simctlsubcommandservice.Privacy.Grant/Revoke/Reset(udid, PrivacyPermission.Calendar, bundleId?)privacy <udid> grant|revoke|reset <service>service.SetAppearance(udid, SimulatorAppearance.Dark)/GetAppearance(udid)ui <udid> appearanceservice.StatusBar.Override(udid, new StatusBarOverrides(Time:"09:41", BatteryLevel:80))/.Clear(udid)status_bar <udid> override|clearservice.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|runservice.AddMedia(udid, paths)addmedia <udid> <files…>service.ScreenCapture.Screenshot(udid, path, ScreenshotFormat.Png)io <udid> screenshotservice.ScreenCapture.StartRecording(udid, path) → IDisposableio <udid> recordVideoStartRecordingreturns anIDisposable; disposing it kills therecordVideoprocess.Pushaccepts either a file path or an inline JSON string — when the payload starts with{it is written to a temp file automatically.New types
PrivacyPermission,SimulatorAppearance,SimulatorBatteryState,SimulatorDataNetwork,ScreenshotFormat,VideoRecordingFormatStatusBarOverrides(all fields optional)RecordingOptions(Format,Force)SimulatorPrivacy,SimulatorStatusBar,SimulatorLocation,SimulatorScreenCapture— all constructed lazily via properties onSimulatorServiceInfrastructure changes
SimulatorServicemadepartialto split feature groups across files.SimCtl.XcrunPathpromoted tointernal staticsoSimulatorScreenCapturecan reference it when starting a persistent recording process.IsExternalInitpolyfill added toNullableAttributes.cs— required for C# 9recordtypes to compile against thenetstandard2.0target.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/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/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)/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/usr/bin/dotnet dotnet build Xamarin.MacDev/Xamarin.MacDev.csproj -nologo -v:minimal(dns block)/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)/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/usr/bin/dotnet dotnet build Xamarin.MacDev/Xamarin.MacDev.csproj -nologo -v:minimal(dns block)kmuvsblobprodcus389.vsblob.vsassets.io/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/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/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/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: