From 42362e29d89377d0bfc6739f1c89947134f3a635 Mon Sep 17 00:00:00 2001 From: Jochen Delabie Date: Mon, 26 Oct 2026 16:29:21 +0100 Subject: [PATCH] fix(ios): driver keeps no XCTest attachments (keepNever) The runner's one test never succeeds - Maestro stops it at session end - so the scheme's default deleteOnSuccess kept every screenshot XCTest took while Maestro polled the screen. On a real iPhone they stay in testmanagerd's data container, where nothing on the host can delete them: +238 full-size PNGs in 60 s during one Maestro session on an iPhone 17 Pro Max, ~2,900 that day, and 93 GB of attachments filling an iPhone 15. Set systemAttachmentLifetime/userAttachmentLifetime = keepNever on the scheme's TestAction, which build-for-testing writes into the .xctestrun (checked: a simulator build-for-testing now emits keepNever for both), and in the checked-in config xctestrun templates. --- .../maestro-driver-ios-config.xctestrun | 4 ++-- .../maestro-driver-ios-config.xctestrun | 4 ++-- .../xcschemes/maestro-driver-ios.xcscheme | 11 ++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/maestro-ios-driver/src/main/resources/driver-iPhoneSimulator/maestro-driver-ios-config.xctestrun b/maestro-ios-driver/src/main/resources/driver-iPhoneSimulator/maestro-driver-ios-config.xctestrun index 1a72105f0e..03cfc40c9c 100644 --- a/maestro-ios-driver/src/main/resources/driver-iPhoneSimulator/maestro-driver-ios-config.xctestrun +++ b/maestro-ios-driver/src/main/resources/driver-iPhoneSimulator/maestro-driver-ios-config.xctestrun @@ -78,7 +78,7 @@ ViewHierarchyHandlerTests/testViewHierarchyHandlerReturnsNonEmptyHierarchy() SystemAttachmentLifetime - deleteOnSuccess + keepNever TestBundlePath __TESTHOST__/PlugIns/maestro-driver-iosUITests.xctest TestHostBundleIdentifier @@ -136,7 +136,7 @@ UITargetAppPerformanceAntipatternCheckerEnabled UserAttachmentLifetime - deleteOnSuccess + keepNever diff --git a/maestro-ios-driver/src/main/resources/driver-iphoneos/maestro-driver-ios-config.xctestrun b/maestro-ios-driver/src/main/resources/driver-iphoneos/maestro-driver-ios-config.xctestrun index 4fd926712e..95b4a778f6 100644 --- a/maestro-ios-driver/src/main/resources/driver-iphoneos/maestro-driver-ios-config.xctestrun +++ b/maestro-ios-driver/src/main/resources/driver-iphoneos/maestro-driver-ios-config.xctestrun @@ -66,7 +66,7 @@ ViewHierarchyHandlerTests/testViewHierarchyHandlerReturnsNonEmptyHierarchy() SystemAttachmentLifetime - deleteOnSuccess + keepNever TestBundlePath __TESTHOST__/PlugIns/maestro-driver-iosUITests.xctest TestHostBundleIdentifier @@ -98,7 +98,7 @@ UITargetAppPath __TESTROOT__/Debug-iphoneos/maestro-driver-ios.app UserAttachmentLifetime - deleteOnSuccess + keepNever diff --git a/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver-ios.xcscheme b/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver-ios.xcscheme index 438a99b961..156383a802 100644 --- a/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver-ios.xcscheme +++ b/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver-ios.xcscheme @@ -22,11 +22,20 @@ + + shouldUseLaunchSchemeArgsEnv = "YES" + systemAttachmentLifetime = "keepNever" + userAttachmentLifetime = "keepNever">