Improve device handling with fallback support and comprehensive tests#209
Open
trmquang93 wants to merge 4 commits intosweetpad-dev:mainfrom
Open
Improve device handling with fallback support and comprehensive tests#209trmquang93 wants to merge 4 commits intosweetpad-dev:mainfrom
trmquang93 wants to merge 4 commits intosweetpad-dev:mainfrom
Conversation
…ests This PR enhances device handling in SweetPad to better support both modern (iOS 17+) and legacy devices: - Enhanced device type definitions with safe defaults for missing fields - Added fallback lookups using xcdevice for devices with incomplete devicectl data - Added deviceUtils module for OS version comparison utilities - Created xcdevice module to query device info from Xcode's xcdevice tool - Created ios-deploy module for deploying to iOS < 17 devices - Added comprehensive test coverage for device management - Added test fixtures with real-world devicectl output samples - Gracefully handle missing device name, OS version, and UDID fields This improves reliability when working with older devices that may not return complete information through devicectl.
hyzyla
reviewed
Feb 3, 2026
…S, watchOS, tvOS, and visionOS devices
…flicts and updated test mocks
Author
|
@hyzyla Gentle bump on this PR! 😊 Let me know if you'd like me to make any adjustments or if you need more information. The tests are all green and it should be safe to merge. |
Collaborator
|
@trmquang93 I'll try to do my best to check it out this week |
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.
Summary
This PR enhances device handling in SweetPad to better support both modern (iOS 17+) and legacy devices (iOS 16 and below).
Changes
Device Type Improvements (
src/devices/types.ts)devicectlIdproperty to distinguish between xcodebuild UDID and devicectl identifiersupportsDevicectlproperty to check if device supports devicectl (iOS 17+)Device Manager Enhancements (
src/devices/manager.ts)New Utilities (
src/devices/utils.ts)supportsDevicectl()function to check if OS version requires devicectlNew xcdevice Module (
src/common/xcode/xcdevice.ts)New ios-deploy Module (
src/common/xcode/ios-deploy.ts)Test Coverage
Testing
The changes have been tested with various device configurations including:
Backward Compatibility
These changes are backward compatible. Existing functionality is preserved while adding fallback support for edge cases with older devices.