Skip to content

feat(parser): use JSON output for iOS simulator parsing#143

Merged
okwasniewski merged 5 commits intomainfrom
oskar/device-family-json-parser
Jan 17, 2026
Merged

feat(parser): use JSON output for iOS simulator parsing#143
okwasniewski merged 5 commits intomainfrom
oskar/device-family-json-parser

Conversation

@okwasniewski
Copy link
Owner

@okwasniewski okwasniewski commented Jan 17, 2026

Summary:

Refactors iOS simulator device parsing from regex-based text parsing to JSON parsing using simctl -j flag. Introduces DeviceFamily enum to reliably identify device types (iPhone, iPad, Watch, TV, Vision) from the deviceTypeIdentifier field instead of matching device names.

This fixes incorrect icon assignment for devices like "iPhone 17 Pro with Apple Watch" which previously matched "Watch" in the name.

Changelog:

  • Add DeviceFamily enum with init from deviceTypeIdentifier
  • Switch simctl list devices to JSON output (-j flag)
  • Update IOSSimulatorParser to decode JSON instead of regex matching
  • Pass deviceFamily to menu items for correct icon selection
  • Update tests for new JSON-based parsing

Test Plan:

  • Unit tests updated and passing for IOSSimulatorParser
  • Tests cover iPhone, iPad, Watch, Vision Pro device families
  • Tests verify paired devices (iPhone with Watch) get correct family

Should resolve: #141

Add DeviceFamily enum to properly identify device types (iPhone, iPad, Watch, TV, Vision) from simctl deviceTypeIdentifier. This enables correct icon selection without relying on name matching.

- Switch simctl to JSON output (-j flag)
- Parse deviceTypeIdentifier for reliable device family detection
- Update menu item to use deviceFamily for icon selection
- Add comprehensive tests for new parsing logic
@okwasniewski okwasniewski merged commit 4c323d8 into main Jan 17, 2026
3 checks passed
@okwasniewski okwasniewski deleted the oskar/device-family-json-parser branch January 17, 2026 09:49
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.

Wrong simulator icon when using iPhone with watch

1 participant