Skip to content

[AOT] Native AOT support for iOS #21066

Closed
1 of 1 issue completed
Closed

Description

@Jen-Uno

Current Bugs?

Runtime Comparisons

Runtime Publish Size 1 Startup Times (s) 2
Uno.Sdk 6.5.0-dev.126 + MonoVM 345 + unoplatform/uno.chefs@dac70319 143781517
137M
0.764
Uno.Sdk 6.5.0-dev.126 + NativeAOT 645 + unoplatform/uno.chefs@dac70319 126968627
121M
0.424
Uno.Sdk 6.5.0-dev.126 + CoreCLR 745 + unoplatform/uno.chefs@dac70319 Not yet supported Not yet supported

Footnotes

  1. Size as reported by: ls -l Chefs/bin/Release/net10.0-ios/ios-arm64/publish/Chefs.ipa ↩

  2. Apply the following patch:

    diff --git a/Chefs/App.xaml.cs b/Chefs/App.xaml.cs
    index 00e463ca..913c5c60 100644
    --- a/Chefs/App.xaml.cs
    +++ b/Chefs/App.xaml.cs
    @@ -48,6 +48,8 @@ public partial class App : Application
     		Host = await builder.NavigateAsync<ShellControl>();
     		Shell = MainWindow.Content as ShellControl;
     
    +		this.Log().LogWarning("# jonp: App Started");
    +
     		if (_exitAfterLaunching)
     		{
     			Exit();
    

    After building and installing, launch Console.app, select your target device in the Sources panel, then click the ▶️Start button in the toolbar.

    Launch the app on the target device.

    Once the app has launched, filter Console.app output by Process:Chefs, look for the first message containing # jonp: App Started, record it's time, and from that time subtract the time of the first message from the Chefs app. ↩

  3. MonoVM Build command

    dotnet publish -c Release -r ios-arm64 -f net10.0-ios -p:TargetFrameworkOverride=net10.0-ios \
      -bl Chefs/Chefs.csproj -p:UseSkiaRendering=true \
      -p:_DeviceName=UDID "-p:CodesignKey=CODESIGN_KEY"
    
    ↩
  4. UDID from: https://learn.microsoft.com/en-us/dotnet/maui/ios/cli?view=net-maui-10.0#launch-the-app-on-a-device ↩ ↩2 ↩3

  5. CODESIGN_KEY from: https://learn.microsoft.com/en-us/dotnet/maui/ios/deployment/publish-cli?view=net-maui-10.0 ↩ ↩2 ↩3

  6. NativeAOT Build command: https://learn.microsoft.com/en-us/dotnet/maui/deployment/nativeaot?view=net-maui-10.0#publish-using-native-aot

    Apply the patch:

    diff --git a/Chefs/Chefs.csproj b/Chefs/Chefs.csproj
    index 2d27ec89..1a503d95 100644
    --- a/Chefs/Chefs.csproj
    +++ b/Chefs/Chefs.csproj
    @@ -25,6 +25,10 @@
     		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
     		<ApplicationVersion>1</ApplicationVersion>
     		<UseMocks Condition="'$(UseMocks)'==''">true</UseMocks>
    +		<IsAotCompatible>true</IsAotCompatible>
    +		<PublishAot Condition=" '$(SkiaPublishAot)' == 'true' And $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true</PublishAot>
    +		<PublishAot Condition=" '$(SkiaPublishAot)' == 'true' And $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">true</PublishAot>
    +		<PublishAot Condition=" '$(PublishAot)' == '' And '$(SkiaPublishAot)' != '' ">$(SkiaPublishAot)</PublishAot>
     		<!--
     			If you encounter this error message:
    

    Build:

    dotnet publish -c Release -r ios-arm64 -f net10.0-ios -p:TargetFrameworkOverride=net10.0-ios \
      -bl Chefs/Chefs.csproj -p:UseSkiaRendering=true -p:SkiaPublishAot=true \
      -p:_DeviceName=UDID "-p:CodesignKey=CODESIGN_KEY"
    
    ↩
  7. CoreCLR Build command

    dotnet publish -c Release -r osx-x64 -f net10.0-desktop -p:TargetFrameworkOverride=net10.0-desktop \
      -p:UseMonoRuntime=false \
      -bl Chefs/Chefs.csproj -p:SelfContained=true -p:UseSkiaRendering=true
    

    Which promptly fails to build:

     Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(544,5): error NETSDK1082: There was no runtime pack for Microsoft.NETCore.App available for the specified RuntimeIdentifier 'ios-arm64'.
    
    ↩

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    kind/enhancement
    triage/untriaged
    difficulty/tbd
    on Jul 16, 2025
  2. added theissue type on Jul 16, 2025
  3. added
    difficulty/challenging 🤯
    area/performance 📈
    and removed
    triage/untriaged
    difficulty/tbd
    on Oct 16, 2025
  4. removed
    kind/enhancement
    difficulty/challenging 🤯
    area/performance 📈
    on Nov 25, 2025
  5. changed the title [-]Native AOT support for iOS[/-] [+][AOT] Native AOT support for iOS[/+] on Nov 25, 2025
  6. jonpryor commented on Jan 21, 2026

    @jonpryor
    Contributor

    2026-01-21 State of Affairs

    Starting with unoplatform/uno.chefs@dac7031 and the following patch applied:

    diff --git a/Chefs/App.xaml.cs b/Chefs/App.xaml.cs
    index 00e463ca..913c5c60 100644
    --- a/Chefs/App.xaml.cs
    +++ b/Chefs/App.xaml.cs
    @@ -48,6 +48,8 @@ public partial class App : Application
     		Host = await builder.NavigateAsync<ShellControl>();
     		Shell = MainWindow.Content as ShellControl;
     
    +		this.Log().LogWarning("# jonp: App Started");
    +
     		if (_exitAfterLaunching)
     		{
     			Exit();
    diff --git a/Chefs/Chefs.csproj b/Chefs/Chefs.csproj
    index 2d27ec89..1a503d95 100644
    --- a/Chefs/Chefs.csproj
    +++ b/Chefs/Chefs.csproj
    @@ -25,6 +25,10 @@
     		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
     		<ApplicationVersion>1</ApplicationVersion>
     		<UseMocks Condition="'$(UseMocks)'==''">true</UseMocks>
    +		<IsAotCompatible>true</IsAotCompatible>
    +		<PublishAot Condition=" '$(SkiaPublishAot)' == 'true' And $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true</PublishAot>
    +		<PublishAot Condition=" '$(SkiaPublishAot)' == 'true' And $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">true</PublishAot>
    +		<PublishAot Condition=" '$(PublishAot)' == '' And '$(SkiaPublishAot)' != '' ">$(SkiaPublishAot)</PublishAot>
     		<!--
     			If you encounter this error message:
     
    diff --git a/global.json b/global.json
    index 6611d206..de610af3 100644
    --- a/global.json
    +++ b/global.json
    @@ -1,6 +1,6 @@
     {
       "msbuild-sdks": {
    -    "Uno.Sdk": "6.4.53"
    +    "Uno.Sdk": "6.5.0-dev.126"
       },
       "sdk": {
         "allowPrerelease": false

    Build for NativeAOT:

    dotnet publish -c Release -r ios-arm64 -f net10.0-ios -p:TargetFrameworkOverride=net10.0-ios \
      -bl Chefs/Chefs.csproj -p:UseSkiaRendering=true -p:SkiaPublishAot=true \
      -p:_DeviceName=UDID "-p:CodesignKey=CODESIGN_KEY"
    

    Install by:

    1. Open the output folder in Finder, e.g. open Chefs/bin/Release/net10.0-ios/ios-arm64/publish
    2. Open Xcode.app
    3. Click Window > Devices and Simulators ⇧⌘2
    4. In the left “tree-view”, select the attached iOS device
    5. In the right panel is an Installed Apps section. Drag-and-drop the .ipa file from the output folder (1) to the Installed Apps section.

    You can launch the app by tapping the app icon in the Home Screen.

    While Uno.Chefs is able to build and run under NativeAOT with Uno.Sdk 6.5.0-dev.104, that doesn't mean it runs properly under NativeAOT.

    Issues:

    Login Screen isn't "normally" usable. Specifically:

    • The Password field cannot be selected by tapping on it. Tapping on the Password field selects the Username field.
    • You can cause the Password field to be selected by tapping Next on the keyboard when the Username field is selected.
    • You can enter text into text fields, when they're selected.
    • You cannot check the [ ] Remember me checkbox.

    #22372 fixes the above issues.

    After logging in, tap the "Profile" button in the top. From the Profile page, the +Create Recipe button does nothing.

    However, this also happens with the MonoVM build! Probably because it doesn't have a Command attribute binding? https://github.com/unoplatform/uno.chefs/blob/53030d9fd54623c13de370afca9213a7921021de/Chefs/Views/ProfilePage.xaml#L42-L53

  7. github-actions commented on Apr 30, 2026

    @github-actions
    Contributor

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.

  8. locked as resolved and limited conversation to collaborators on Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions