From 8f9ebf1e6dff113d065ab1094027616a8181d498 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 24 Sep 2026 14:54:43 +0800 Subject: [PATCH] [3.13] gh-158051: Update testbed to support Xcode 27 (GH-158052) Modify testbed to target iOS 15 as a minimum, and use a UIScene lifecycle. These changes are required by Xcode 27, but are backwards compatible to at least Xcode 16. (cherry picked from commit daacd2d9a2b47ee277f398ed024afe6ced6f039f) Co-authored-by: Russell Keith-Magee --- ...-09-24-10-40-28.gh-issue-158051.B1ZBTA.rst | 1 + .../iOSTestbed.xcodeproj/project.pbxproj | 18 ++++++++++------ iOS/testbed/iOSTestbed/AppDelegate.m | 9 ++++++-- iOS/testbed/iOSTestbed/SceneDelegate.h | 12 +++++++++++ iOS/testbed/iOSTestbed/SceneDelegate.m | 21 +++++++++++++++++++ iOS/testbed/iOSTestbed/iOSTestbed-Info.plist | 12 ++++++++++- 6 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2026-09-24-10-40-28.gh-issue-158051.B1ZBTA.rst create mode 100644 iOS/testbed/iOSTestbed/SceneDelegate.h create mode 100644 iOS/testbed/iOSTestbed/SceneDelegate.m diff --git a/Misc/NEWS.d/next/Tests/2026-09-24-10-40-28.gh-issue-158051.B1ZBTA.rst b/Misc/NEWS.d/next/Tests/2026-09-24-10-40-28.gh-issue-158051.B1ZBTA.rst new file mode 100644 index 00000000000000..202fb12086210c --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-09-24-10-40-28.gh-issue-158051.B1ZBTA.rst @@ -0,0 +1 @@ +The iOS testbed has been updated for compatibilty with Xcode 27. diff --git a/iOS/testbed/iOSTestbed.xcodeproj/project.pbxproj b/iOS/testbed/iOSTestbed.xcodeproj/project.pbxproj index 18cdafd8127520..183dc6aa9ecaa6 100644 --- a/iOS/testbed/iOSTestbed.xcodeproj/project.pbxproj +++ b/iOS/testbed/iOSTestbed.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 607A66172B0EFA380010BFC8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 607A66162B0EFA380010BFC8 /* AppDelegate.m */; }; + 71CB095279CCE565BAFB69C3 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D995ADFDE8B3EF5DDEB37874 /* SceneDelegate.m */; }; 607A66222B0EFA390010BFC8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607A66212B0EFA390010BFC8 /* Assets.xcassets */; }; 607A66252B0EFA390010BFC8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607A66232B0EFA390010BFC8 /* LaunchScreen.storyboard */; }; 607A66282B0EFA390010BFC8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 607A66272B0EFA390010BFC8 /* main.m */; }; @@ -60,6 +61,8 @@ 607A66122B0EFA380010BFC8 /* iOSTestbed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSTestbed.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607A66152B0EFA380010BFC8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 607A66162B0EFA380010BFC8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 83DC5E71F9D64737365A3BE4 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + D995ADFDE8B3EF5DDEB37874 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; 607A66212B0EFA390010BFC8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 607A66242B0EFA390010BFC8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 607A66272B0EFA390010BFC8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; @@ -123,6 +126,8 @@ 607A66572B0F079F0010BFC8 /* dylib-Info-template.plist */, 607A66152B0EFA380010BFC8 /* AppDelegate.h */, 607A66162B0EFA380010BFC8 /* AppDelegate.m */, + 83DC5E71F9D64737365A3BE4 /* SceneDelegate.h */, + D995ADFDE8B3EF5DDEB37874 /* SceneDelegate.m */, 607A66212B0EFA390010BFC8 /* Assets.xcassets */, 607A66232B0EFA390010BFC8 /* LaunchScreen.storyboard */, 607A66272B0EFA390010BFC8 /* main.m */, @@ -295,6 +300,7 @@ buildActionMask = 2147483647; files = ( 607A66172B0EFA380010BFC8 /* AppDelegate.m in Sources */, + 71CB095279CCE565BAFB69C3 /* SceneDelegate.m in Sources */, 607A66282B0EFA390010BFC8 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -381,7 +387,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -436,7 +442,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -462,7 +468,7 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -493,7 +499,7 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -516,7 +522,7 @@ DEVELOPMENT_TEAM = 3HEZE76D99; GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/Python.framework/Headers\""; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = org.python.iOSTestbedTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -536,7 +542,7 @@ DEVELOPMENT_TEAM = 3HEZE76D99; GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/Python.framework/Headers\""; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = org.python.iOSTestbedTests; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/iOS/testbed/iOSTestbed/AppDelegate.m b/iOS/testbed/iOSTestbed/AppDelegate.m index e5085399d0ca5f..fbe71bae23b718 100644 --- a/iOS/testbed/iOSTestbed/AppDelegate.m +++ b/iOS/testbed/iOSTestbed/AppDelegate.m @@ -4,6 +4,7 @@ // #import "AppDelegate.h" +#import "SceneDelegate.h" @interface AppDelegate () @@ -11,9 +12,13 @@ @interface AppDelegate () @implementation AppDelegate +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + UISceneConfiguration *configuration = [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; + configuration.delegateClass = [SceneDelegate class]; + return configuration; +} -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - return YES; +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { } @end diff --git a/iOS/testbed/iOSTestbed/SceneDelegate.h b/iOS/testbed/iOSTestbed/SceneDelegate.h new file mode 100644 index 00000000000000..264aacadca16e5 --- /dev/null +++ b/iOS/testbed/iOSTestbed/SceneDelegate.h @@ -0,0 +1,12 @@ +// +// SceneDelegate.h +// iOSTestbed +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/iOS/testbed/iOSTestbed/SceneDelegate.m b/iOS/testbed/iOSTestbed/SceneDelegate.m new file mode 100644 index 00000000000000..e82e447985d2e9 --- /dev/null +++ b/iOS/testbed/iOSTestbed/SceneDelegate.m @@ -0,0 +1,21 @@ +// +// SceneDelegate.m +// iOSTestbed +// + +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + UIWindowScene *windowScene = (UIWindowScene *)scene; + self.window = [[UIWindow alloc] initWithWindowScene:windowScene]; + self.window.rootViewController = [[UIViewController alloc] init]; + [self.window makeKeyAndVisible]; +} + +@end diff --git a/iOS/testbed/iOSTestbed/iOSTestbed-Info.plist b/iOS/testbed/iOSTestbed/iOSTestbed-Info.plist index fea45e1fad6f6f..3a560656972aec 100644 --- a/iOS/testbed/iOSTestbed/iOSTestbed-Info.plist +++ b/iOS/testbed/iOSTestbed/iOSTestbed-Info.plist @@ -46,7 +46,17 @@ UIApplicationSupportsMultipleScenes UISceneConfigurations - + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + + +