![]() |
|
[DevBlog MS] Get Your .NET MAUI App Ready for Xcode 27 - Printable Version +- Sick Gaming (https://sickgaming.net) +-- Forum: Programming (https://sickgaming.net/forum-76.html) +--- Forum: C#, Visual Basic & .NET (https://sickgaming.net/forum-79.html) +--- Thread: [DevBlog MS] Get Your .NET MAUI App Ready for Xcode 27 (/thread-114027.html) |
[DevBlog MS] Get Your .NET MAUI App Ready for Xcode 27 - xSicKxBot - 10-19-2026 Your existing .NET MAUI app builds with Xcode 27, installs on an iPhone running iOS 27, shows its splash screen, and then disappears. Not exactly the grand entrance you were hoping for. That symptom can have many causes. But if the only thing that changed is that you’re now building with Xcode 27 and running the app on iOS 27, and you see the device log message below, your .NET MAUI app needs a few changes: Code: [code]UIScene life cycle is required for apps built with this SDK.[/code]UIKit’s scene lifecycle manages each instance of an app’s user interface, including its windows and transitions between foreground and background states. It works alongside the application lifecycle, which manages the app process as a whole. Apple introduced this model with iOS 13, and .NET MAUI already supports it. This is an Xcode 27 compatibility requirement, not a broken .NET MAUI lifecycle. Existing .NET MAUI projects might still use only the older application lifecycle because updating .NET MAUI or its workloads doesn’t rewrite their platform files. It’s not specific to the iPhone Duo. Every iOS app built with Xcode 27, on any form factor, needs to adopt this pattern. An existing binary built with an older SDK doesn’t suddenly need this migration just because someone updates their phone. For a straightforward app, the change is small: a scene delegate and an Code: Info.plistThat’s where the Code: maui-xcode27-migrationLet an AI agent handle the migration The .NET MAUI CLI can install agent skills into your development environment. A skill is a set of instructions and supporting resources for the agent. It’s not another runtime dependency in your app. The Xcode 27 migration skill requires Microsoft.Maui.Cli 0.1.0-preview.13.26512.5 or later. Install that preview release: Code: [code]dotnet tool install --global Microsoft.Maui.Cli --version 0.1.0-preview.13.26512.5[/code]If you already have it installed, update it instead: Code: [code]dotnet tool update --global Microsoft.Maui.Cli --version 0.1.0-preview.13.26512.5[/code]Preview tooling The .NET MAUI CLI and this skill are experimental and are not covered by the Microsoft Support Policy. The CLI downloads the skill from the public Code: dotnet/maui-labsFrom your app’s repository, check that the CLI can find the skill and install it for GitHub Copilot CLI: Code: [code]maui ai list skill
maui ai add skill maui-xcode27-migration --env CopilotCli --yes[/code]If you use another AI provider, check Code: maui ai add skill --helpCode: --envRestart or reload your agent session so it picks up the new skill, then ask: Code: [code]Prepare this .NET MAUI app for Xcode 27. Inspect the project
and toolchain first, preserve custom lifecycle behavior, and validate
the migration. Ask before changing the SDK or dropping support for
older OS versions.[/code]You don’t need to name the skill in your request. A compatible agent should pick Code: maui-xcode27-migrationThe CLI installs the skill, and your coding agent does the migration. There’s no Code: maui migratePrefer to manage the skill directly with GitHub Copilot CLI? Follow the official GitHub Copilot plugin installation documentation, then add the Code: maui-labsCode: dotnet-mauiCode: [code]copilot plugin marketplace add dotnet/maui-labs
copilot plugin install dotnet-maui@dotnet-maui-labs[/code]You can also find the migration skill directly in the Code: dotnet/maui-labsWhat the skill checks Before editing anything, the skill should work out which project, .NET SDK, .NET MAUI packages, Apple workloads, and Xcode version you’re actually using. A Code: global.jsonThe migration covers:
Commit or otherwise save your current work before starting, and go through the resulting diff before accepting it. A successful build doesn’t prove that an authentication redirect or a Home screen shortcut still works. If you’d rather do things by hand, the instructions are below. Before you start: check your app and toolchain Scene lifecycle support was available before Xcode 27, so your app might already use it. If you already have a Code: MauiUISceneDelegateAt the time of writing, the released .NET 10 iOS and Mac Catalyst workloads 27.0.10722 require Xcode 27.0. Installing a newer Xcode doesn’t automatically make it compatible with that workload. Check the .NET for iOS and Mac Catalyst release notes and use the matching versions rather than disabling the SDK’s Xcode check. Check your setup Run Code: maui doctorFor a .NET 10 app, update your .NET MAUI packages to 10.0.110 or higher before enabling scenes. The two-file launch fix can work with an older .NET MAUI version because Code: MauiUISceneDelegateCode: WebAuthenticatorTemplate projects often get Code: $(MauiVersion)Code: .csprojCode: [code]<PropertyGroup>
<MauiVersion>10.0.110</MauiVersion>
</PropertyGroup>[/code]If you already manage this version elsewhere, update that value instead. Don’t downgrade a newer compatible version. Apps created with the .NET MAUI 10.0.110 templates already have the scene configuration. Existing projects aren’t retrofitted by a package or workload update, so you’ll need to do that part yourself. Add the scene delegate In your existing app, create Code: Platforms/iOS/SceneDelegate.csCode: [code]using Foundation;
using Microsoft.Maui;
namespace MyMauiApp;
[Register("SceneDelegate")]
public class SceneDelegate : MauiUISceneDelegate
{
}[/code]Replace Code: MyMauiAppCode: SceneDelegateYes, that’s the whole class. .NET MAUI does the actual window setup for you. Leave your existing Code: AppDelegate : MauiUIApplicationDelegateAdd the scene manifest Open Code: Platforms/iOS/Info.plistCode: <dict>Code: UIApplicationSceneManifestCode: [code]<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>__MAUI_DEFAULT_SCENE_CONFIGURATION__</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>[/code]Three details matter here:
You don’t need a Code: UISceneStoryboardFileIf you have custom scene configuration names or override Code: GetConfigurationCode: WillConnectCode: MauiUISceneDelegateCode: __MAUI_DEFAULT_SCENE_CONFIGURATION__Some apps select a different plist for Debug, Release, customer, or environment builds. Add or reconcile the manifest in every plist that can produce a shipping app. If you only update the default file, one configuration can still crash right after the splash screen. Preserve the existing Code: MauiSplashScreenCode: UILaunchStoryboardNameThat’s the iOS scene configuration done. If you don’t target Mac Catalyst, skip ahead to the minimum OS versions. Do the same for Mac Catalyst If your project also targets Mac Catalyst, make the same two changes there:
Check your minimum OS versions The .NET for iOS and .NET for Mac Catalyst 27 SDKs also raise the minimum supported versions: iOS needs at least Code: 15.0Code: 17.0Code: .csprojCode: SupportedOSPlatformVersionCode: [code]<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">17.0</SupportedOSPlatformVersion>[/code]These entries belong inside a Code: <PropertyGroup>Keep a higher deployment target if your app already requires one. If you must retain support for iOS versions below 15 or macOS 12 and 13, moving to these SDKs requires a support-policy decision. Stay on a compatible 26.x SDK while you decide, rather than silently dropping those users. This SDK minimum is separate from scene adoption; see the .NET MAUI template deployment-target guidance. Check any custom app behavior With scenes enabled, UIKit no longer calls the Code: AppDelegateCode: ConfigureLifecycleEventsCode: AppDelegateCode: OpenUrlCode: ContinueUserActivityExisting event Scene event Code: OnActivatedCode: SceneOnActivatedCode: OnResignActivationCode: SceneOnResignActivationCode: DidEnterBackgroundCode: SceneDidEnterBackgroundCode: WillEnterForegroundCode: SceneWillEnterForegroundCode: OpenUrlCode: SceneOpenUrlCode: ContinueUserActivityCode: SceneContinueUserActivityThe callback arguments differ, so move the logic instead of just renaming the registration. If you instead override methods in your Code: SceneDelegateCode: baseFor custom deep links, also handle Code: SceneWillConnectCode: UISceneConnectionOptionsIf your app opens content from a notification tap, inspect Code: connectionOptions.NotificationResponseCode: DidReceiveRemoteNotificationA regular launch may have no URL or user-activity payload. Guard against absent Code: UrlContextsCode: UserActivitiesCode: FinishedLaunchingCode: AppDelegate.WindowCode: nullCode: base.FinishedLaunchingCode: Window.NET MAUI 10.0.110 handles scene-based App Actions and forwards the relevant URL and user-activity callbacks to Code: WebAuthenticatorIf you use App Actions, make sure every custom Code: PerformActionForShortcutItemCode: trueCode: falseEven a handler that only writes a log message needs to respond. As an example, add Code: using Microsoft.Maui.LifecycleEvents;Code: MauiProgram.csCode: CreateMauiAppCode: return builder.Build();Code: [code]builder.ConfigureLifecycleEvents(events =>
{
#if IOS || MACCATALYST
events.AddiOS(ios => ios
.PerformActionForShortcutItem((application, shortcutItem, completion) =>
{
Console.WriteLine($"App Action received: {shortcutItem.Type}");
completion(false);
}));
#endif
});[/code]The default .NET MAUI builder already forwards App Actions to Essentials. You don’t need this logging observer unless you want it, and you shouldn’t add another Code: Platform.PerformActionForShortcutItemCode: AppDelegateCode: PerformActionForShortcutItemRebuild and try it Restore and build the iOS target: Code: [code]dotnet restore -p:TargetFramework=net10.0-ios
dotnet build -f net10.0-ios --no-restore[/code]If the simulator still seems to have an old version of your app, uninstall it, delete the app project’s Code: binCode: objLaunch both Debug and Release builds on a regular iPhone or iPad simulator running iOS 27 with the matching workload and Xcode. A successful build or launch on iOS 26 doesn’t prove that the app will launch on iOS 27 when built with Xcode 27. Check a cold launch, background and foreground transitions, your authentication flow, links and notification taps with the app both running and closed, and App Actions. If you target Mac Catalyst, build and exercise that target too. You don’t need an iPhone Duo simulator to verify this migration. Device-specific layouts and the Xcode 27.1 tooling are a separate topic that we’ll cover in a follow-up post soon. The post Get Your .NET MAUI App Ready for Xcode 27 appeared first on .NET Blog. |