Repository navigation
feat(devices): show app crashes as a toast in the simulator panel - #20
Open
lauridskern wants to merge 1 commit into
Open
lauridskern wants to merge 1 commit into
lauridskern wants to merge 1 commit into
Conversation
Detect app crashes and surface them on the device they happened on, with actions to attach the crash or ask for a fix in chat. - iOS simulators report a crash the moment SpringBoard logs the exit, add the app's own last log lines about a second later, and replace them with the symbolicated .ips report once ReportCrash writes it. - Android collects FATAL EXCEPTION blocks and libc fatal signals from a narrow logcat stream. - Each visible simulator panel runs an app-only crash session, so the toast works without the Logs tool. Log sessions run the same watcher scoped to their app or process, and crash rows can be found with kind:crash. - Crash records carry a short `reason` so the UI never re-parses messages.
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.
What
When an app crashes on an iOS simulator or Android device, the simulator panel now shows a toast with the app name, the crash reason and the stack trace, plus Fix in chat and Attach actions. Before this, a crash just looked like the app disappeared.
Covers the "Catch app crashes and send them to chat" idea from the Mobile Dev Ideas board.
How it works
.ipsreport from~/Library/Logs/DiagnosticReportsreplaces it once ReportCrash writes it, typically 30–45 s later. That delay comes from macOS.logcat AndroidRuntime:E libc:F *:Sstream turns eachFATAL EXCEPTIONblock or libc fatal signal into one crash record.mobile_crashes_sessionthat long-polls for up to 20 s and pauses reads while hidden. Log sessions run the same watcher (startCrashWatch), scoped to the app or process they follow, so agents also see crash records viamobile_read_logs, andkind:crashfilters them in Logs.reason, so the UI never parses messages.Structure
src/server/crash-reports.tsowns all crash detection: pure parsers, the.ipswatcher, the SpringBoard exit stream, Android collection, and thestartCrashWatchentry point.native-logs.tschanges only by gaining a sharedkeepReadingretry helper, which its existing loop now uses too, and a genericrunLogProcess.src/ui/crash-monitor.tsholds the per-panel session and toast state;components/crash-toast.tsxis the view, built from shadcnButtons and lucide icons.Telemetry
logs.crash.detectedcounts crashes withdevice_platformandcrash_source(ios_exit,ios_log,ios_report,android_logcat).logs.crash.parsetimes.ipsparsing.ui.crash.*(toast shown, attached, sent to chat, dismissed, report attached, watch retry).docs/telemetry.md.Limitations
kill -ABRT, writes no app log lines, so its stack only arrives with the.ipsreport.Testing
npm test: 724 passed, 0 failed, 1 skipped. Newtests/crash-reports.test.tscovers:.ips, SpringBoard and app-log parsingtscadds no errors over main.npm run typecheck:telemetrypasses.