Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

GetLogsPlainAsync does not capture managed .NET exception stack traces from iOS simulator

Open
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp, ios, macos
Domain
devtools

Research direction

Start at SimCtl.GetLogsPlainAsync and the command construction it uses. Compare its current log query with the issue's xcrun simctl log show process-predicate example, then run the described simulator reproduction. Done means an optional process filter captures managed exception lines while preserving the existing unfiltered behavior; no test file is named in the issue.

Written by the indexing model from the issue text.

Description

Summary

SimCtl.GetLogsPlainAsync() captures system-level logs but misses managed .NET exception details (stack traces from xamarin_unhandled_exception_handler) when an app crashes on the iOS simulator.

How to reproduce

  1. Run a .NET MAUI app on an iOS simulator that crashes with an unhandled managed exception
  2. Call SimCtl.GetLogsPlainAsync(deviceId, start: startTime) to capture the logs
  3. The resulting log lines contain ~17K lines of OS-level noise (launchservices, containermanager, SpringBoard, etc.) but no managed exception or stack trace

Expected

The captured log should include managed exception output from the Mono runtime, which is available in the unified logging system.

What works instead

Querying the unified log directly with a process predicate captures the full managed exception:

xcrun simctl spawn <device-udid> log show \
  --predicate 'process == "MyApp"' \
  --style compact \
  --start '2026-05-08 02:13:00'

This returns the full managed stack trace:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Maui.Controls.Button.LayoutButton(UIButton platformButton, Button button, Rect size)
   at Microsoft.Maui.Controls.Button.Microsoft.Maui.ICrossPlatformLayout.CrossPlatformArrange(Rect bounds)
   at Microsoft.Maui.Platform.WrapperView.LayoutSubviews()
   at UIKit.UIApplication.UIApplicationMain(...)
   at MyApp.Program.Main(String[] args)

Suggestion

It would be helpful to have an option on GetLogsPlainAsync (or a new method) that filters to a specific process name using the --predicate 'process == "..."' flag, so consumers can capture process-specific logs including managed exceptions.

Something like:

var logLines = await simCtl.GetLogsPlainAsync(deviceId, start: startTime, processName: "MyApp");

Environment

  • macOS 26.4.1
  • .NET 10.0
  • iOS Simulator 16.2
  • AppleDev.Tools (latest)
Dominant language
C#
Stars
55
Forks
5
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Redth/AppleDev.Tools

All issues in Redth/AppleDev.Tools

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.