Ran into the same wall. As far as I could find there's no way to fold the Duo simulator from a script. simctl and XCTest can't do it, only the DeviceHub app can. What made it bearable for screenshots:
Fold or unfold by hand in DeviceHub once per pose, then let the script do everything for that pose (all screens, all languages). That way you only touch it once per pose per run instead of once per screen.
Don't tap through the UI to reach each screen. Synthetic taps were unreliable on the Duo simulator for me, so I launch with arguments that open the screen I want, or seed the state first with xcrun simctl spawn <udid> defaults write <bundle id> ..., then capture.
Each display is its own screen, so capture them separately. xcrun simctl io <udid> enumerate gives you the display UUIDs, then xcrun simctl io <udid> screenshot --display=<UUID> --mask=black shot.png.
Doesn't solve real UI testing in every pose, but it cuts the manual part down to a few clicks.
2
u/Fickle-Difference882 Oct 18 '26
Ran into the same wall. As far as I could find there's no way to fold the Duo simulator from a script. simctl and XCTest can't do it, only the DeviceHub app can. What made it bearable for screenshots:
xcrun simctl spawn <udid> defaults write <bundle id> ..., then capture.xcrun simctl io <udid> enumerategives you the display UUIDs, thenxcrun simctl io <udid> screenshot --display=<UUID> --mask=black shot.png.Doesn't solve real UI testing in every pose, but it cuts the manual part down to a few clicks.