Skip to content

Stop the preview app quitting on Xcode's launch arguments - #10

Merged
winebarrel merged 1 commit into
mainfrom
fix/preview-launch-args
Aug 9, 2026
Merged

winebarrel merged 1 commit into
mainfrom
fix/preview-launch-args

Conversation

@winebarrel

Copy link
Copy Markdown
Owner

Running the MacstifyPreview scheme quit before the window appeared.

Xcode launches the app with NSUserDefaults-style arguments — Document Versions is on by default in the Run action, which adds -NSDocumentRevisionsDebugMode YES — and the parser threw on the first argument it didn't recognise:

$ MacstifyPreview -NSDocumentRevisionsDebugMode YES
unknown argument: -NSDocumentRevisionsDebugMode
exit=1

Single-dash flags and the value after them are now skipped. A misspelt --option still fails loudly, which is the case actually worth catching.

Verification

Input Result
-NSDocumentRevisionsDebugMode YES -ApplePersistenceIgnoreState YES --snapshot … writes the PNG, exit 0
--optoins unknown argument: --optoins, exit 1
live window with Xcode's arguments process stays up, window visible

make lint and swiftformat --lint pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MVZKaTdW5LpcwGnwAV22ZV

Running the MacstifyPreview scheme quit before the window appeared.
Xcode launches the app with NSUserDefaults-style arguments - Document
Versions is on by default in the Run action, which adds
`-NSDocumentRevisionsDebugMode YES` - and the parser threw on the first
argument it did not recognise.

Single-dash flags and the value after them are now skipped. A misspelt
`--option` still fails loudly, which is the case worth catching.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@winebarrel
winebarrel merged commit 327c909 into main Aug 9, 2026
3 checks passed
@winebarrel
winebarrel deleted the fix/preview-launch-args branch August 9, 2026 09:12
winebarrel added a commit that referenced this pull request Aug 9, 2026
Stop the preview app quitting on Xcode's launch arguments
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.

1 participant