Post

Replies

Boosts

Views

Activity

XCUITest accessibility snapshot reports stale frames during live scene resize
We exercise four layout modes in our SwiftUI app and need to drive them in UI tests. While a scene is resized live via xcrun devicectl device appResize, XCUITest's accessibility snapshot appears to carry a stale scale. With 951×669 requested, app.windows.firstMatch.frame comes back as {317, 223}, which is inconsistent with the app's own reading of its window (951×629 from our debug readout). Individual element frames are similarly tiny (a text label reports 2.9×0.9 pt). As a result .tap() appears to target the right element but the sheet never opens. We verified this with debugDescription dumps across two separate attempts, on clean boots. Is this a known limitation of XCUITest during live scene resizing, and is there a supported way to force the accessibility snapshot to refresh after a resize?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
10
10m
Recommended SwiftUI API for observing fold posture on iPhone Duo
Our adaptive split layout currently pins the posture to .flat because we could not find the supported way to read the device's fold state. What is the recommended SwiftUI API for observing fold posture and hinge geometry on iPhone Duo, and does it report correctly in the simulator as well as on device? We also want to know whether the hinge region is exposed so we can keep content out of it.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
16
1h
Supported way to put an iPhone Duo simulator into the unfolded state programmatically
The Duo simulator boots showing only the outer display: the window is fixed at 382×644 pt and our layout classifier always reports the compact stack mode. We measured this on two separate clean boots (shutdown, erase, boot). xcrun simctl help lists no subcommand for folding, posture, or selecting the inner display — we read the full list. xcrun simctl io screenshot does reveal a second display (LCD-1, 2007×2853 px, aspect 0.70, close to the 669×951 inner portrait size). Unfolding manually in the Simulator UI works and the app then renders the two-column layout correctly, but we could not find a programmatic equivalent. Is there a supported way to unfold a Duo simulator from the command line or from XCTest?
Topic: UI Frameworks SubTopic: SwiftUI
1
2
43
3h
Is devicectl appResize the intended mechanism for testing foldable scene sizes?
As a workaround we used xcrun devicectl device appResize. It works: setting 951×669 makes our layout classifier report wideSplit and 669×951 reports tallSplit, confirmed from the app's own debug readouts. Two behaviours we had to discover empirically: the resize must be applied while xcodebuild test is already running, because xcodebuild's own app launch resets a size set beforehand; and appResize start needs roughly six seconds to establish the session, failing at two seconds with "not currently hosting a resizable app session". Is appResize the intended mechanism for exercising foldable scene sizes in tests, or is there a first-class API we should be using instead?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
7
8h
XCUITest accessibility snapshot reports stale frames during live scene resize
We exercise four layout modes in our SwiftUI app and need to drive them in UI tests. While a scene is resized live via xcrun devicectl device appResize, XCUITest's accessibility snapshot appears to carry a stale scale. With 951×669 requested, app.windows.firstMatch.frame comes back as {317, 223}, which is inconsistent with the app's own reading of its window (951×629 from our debug readout). Individual element frames are similarly tiny (a text label reports 2.9×0.9 pt). As a result .tap() appears to target the right element but the sheet never opens. We verified this with debugDescription dumps across two separate attempts, on clean boots. Is this a known limitation of XCUITest during live scene resizing, and is there a supported way to force the accessibility snapshot to refresh after a resize?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
10
Activity
10m
Recommended SwiftUI API for observing fold posture on iPhone Duo
Our adaptive split layout currently pins the posture to .flat because we could not find the supported way to read the device's fold state. What is the recommended SwiftUI API for observing fold posture and hinge geometry on iPhone Duo, and does it report correctly in the simulator as well as on device? We also want to know whether the hinge region is exposed so we can keep content out of it.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
16
Activity
1h
Supported way to put an iPhone Duo simulator into the unfolded state programmatically
The Duo simulator boots showing only the outer display: the window is fixed at 382×644 pt and our layout classifier always reports the compact stack mode. We measured this on two separate clean boots (shutdown, erase, boot). xcrun simctl help lists no subcommand for folding, posture, or selecting the inner display — we read the full list. xcrun simctl io screenshot does reveal a second display (LCD-1, 2007×2853 px, aspect 0.70, close to the 669×951 inner portrait size). Unfolding manually in the Simulator UI works and the app then renders the two-column layout correctly, but we could not find a programmatic equivalent. Is there a supported way to unfold a Duo simulator from the command line or from XCTest?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
2
Views
43
Activity
3h
XCUIDevice.shared.orientation appears to be a no-op on iPhone Duo (iOS 27.1)
Setting XCUIDevice.shared.orientation has no effect on the Duo simulator running iOS 27.1 — the window size and our computed layout mode stay unchanged. We measured this on two clean boots. On other devices (iPhone 18 Pro, iOS 27.0) the same call works as expected. Is orientation expected to be a no-op on Duo, or are we holding it wrong?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
8
Activity
8h
Is devicectl appResize the intended mechanism for testing foldable scene sizes?
As a workaround we used xcrun devicectl device appResize. It works: setting 951×669 makes our layout classifier report wideSplit and 669×951 reports tallSplit, confirmed from the app's own debug readouts. Two behaviours we had to discover empirically: the resize must be applied while xcodebuild test is already running, because xcodebuild's own app launch resets a size set beforehand; and appResize start needs roughly six seconds to establish the session, failing at two seconds with "not currently hosting a resizable app session". Is appResize the intended mechanism for exercising foldable scene sizes in tests, or is there a first-class API we should be using instead?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
7
Activity
8h