From cbc713f01fea0170d5d73cb6f4542a6b31b673a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 24 Sep 2026 09:30:27 +0200 Subject: [PATCH 1/2] fix(ios-runner): adopt the scene lifecycle so the host app launches on the iOS 27 SDK Built with the Xcode 27 SDK, UIKit traps a legacy app-delegate app at launch in UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption, so every XCTest that launched the runner host app failed on iOS 27 runtimes. The host app now uses one scene delegate that owns the window on iOS, tvOS and visionOS. A single-scene UIApplicationSceneManifest naming that delegate is merged into the generated Info.plist for the UIKit SDKs; the macOS AppKit host is unchanged. The legacy UIScreen-sized app-delegate window and the visionOS-only configurationForConnectingSceneSession path are removed. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../project.pbxproj | 17 +++++++++ .../AgentDeviceRunner/AgentDeviceRunnerApp.m | 37 +------------------ .../AgentDeviceRunner/Info.plist | 23 ++++++++++++ 3 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 apple/runner/AgentDeviceRunner/AgentDeviceRunner/Info.plist diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj b/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj index 506ee028df..f6c7706c48 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj @@ -21,9 +21,22 @@ 20EA2EDD2F2CFC7C001CF0EF /* AgentDeviceRunnerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AgentDeviceRunnerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 20EA2EF02F2CFC7C001CF0EF /* Exceptions for "AgentDeviceRunner" folder in "AgentDeviceRunner" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = 20EA2EC52F2CFC7B001CF0EF /* AgentDeviceRunner */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + /* Begin PBXFileSystemSynchronizedRootGroup section */ 20EA2EC82F2CFC7B001CF0EF /* AgentDeviceRunner */ = { isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 20EA2EF02F2CFC7C001CF0EF /* Exceptions for "AgentDeviceRunner" folder in "AgentDeviceRunner" target */, + ); path = AgentDeviceRunner; sourceTree = ""; }; @@ -352,6 +365,8 @@ DEVELOPMENT_TEAM = 2S799L9W4M; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AgentDeviceRunner/Info.plist; + "INFOPLIST_FILE[sdk=macosx*]" = ""; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = NO; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -386,6 +401,8 @@ DEVELOPMENT_TEAM = 2S799L9W4M; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AgentDeviceRunner/Info.plist; + "INFOPLIST_FILE[sdk=macosx*]" = ""; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = NO; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m b/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m index 937f0f3d59..08da7d0762 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m @@ -319,7 +319,7 @@ - (void)viewDidLoad { @end -#if defined(TARGET_OS_VISION) && TARGET_OS_VISION +// UIApplicationSceneManifest in Info.plist names this class; a rename must update the manifest. @interface AgentDeviceRunnerSceneDelegate : UIResponder @property(nonatomic, strong) UIWindow *window; @end @@ -342,46 +342,11 @@ - (void)scene:(UIScene *)scene } @end -#endif @interface AgentDeviceRunnerAppDelegate : UIResponder -@property(nonatomic, strong) UIWindow *window; @end @implementation AgentDeviceRunnerAppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - (void)application; - (void)launchOptions; - -#if defined(TARGET_OS_VISION) && TARGET_OS_VISION - return YES; -#else - self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; - self.window.rootViewController = [[AgentDeviceRunnerViewController alloc] init]; - [self.window makeKeyAndVisible]; - - return YES; -#endif -} - -#if defined(TARGET_OS_VISION) && TARGET_OS_VISION -- (UISceneConfiguration *)application:(UIApplication *)application - configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession - options:(UISceneConnectionOptions *)options { - (void)application; - (void)connectingSceneSession; - (void)options; - - UISceneConfiguration *configuration = - [[UISceneConfiguration alloc] initWithName:@"Default Configuration" - sessionRole:UIWindowSceneSessionRoleApplication]; - configuration.delegateClass = AgentDeviceRunnerSceneDelegate.class; - return configuration; -} -#endif - @end int main(int argc, char *argv[]) { diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunner/Info.plist b/apple/runner/AgentDeviceRunner/AgentDeviceRunner/Info.plist new file mode 100644 index 0000000000..af35d72e3e --- /dev/null +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunner/Info.plist @@ -0,0 +1,23 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + AgentDeviceRunnerSceneDelegate + + + + + + From ad352d39cacdd9426aeb9db734e9a8d9d0a6d7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 24 Sep 2026 09:41:49 +0200 Subject: [PATCH 2/2] docs(agents): tie the UIScene launch trap to the iOS 27 SDK on 27.0 and 27.1 Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/agents/device-verification.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/agents/device-verification.md b/docs/agents/device-verification.md index 29391a4f26..ce843cbe9f 100644 --- a/docs/agents/device-verification.md +++ b/docs/agents/device-verification.md @@ -91,8 +91,8 @@ toolchain per command: reports it as `overlayWarning` on `record stop` rather than returning a broken file. Only reach for `record start --hide-touches` when you want the fastest raw capture, not to dodge the defect. See ADR 0025 and #2707. -- An app must adopt the UIScene lifecycle to launch on iOS 27.1 at all: a legacy - `UIApplicationDelegate` app traps at launch inside +- An app built with the iOS 27 SDK must adopt the UIScene lifecycle to launch on an iOS 27.0 or + 27.1 simulator at all: a legacy `UIApplicationDelegate` app traps at launch inside `___UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption`, which reads like a broken device but is not one. - The 27.1 runtime in this beta accepts only the `iPhone Duo` device type, so a second non-foldable