Skip to content

chore: iOS support for Native AOT - #1725

Merged
jonpryor merged 1 commit into
mainfrom
dev/jonpryor/jonp-nativeaot-support
Jan 21, 2026
Merged

jonpryor merged 1 commit into
mainfrom
dev/jonpryor/jonp-nativeaot-support

Conversation

@jonpryor

Copy link
Copy Markdown
Collaborator

Context: unoplatform/uno#21066
Context: unoplatform/uno@92676ea
Context: https://learn.microsoft.com/en-us/dotnet/maui/deployment/nativeaot?view=net-maui-10.0#publish-using-native-aot

MAUI documentation suggests that the .csproj should be modified to contain $(PublishAot) instead of specifying it on the command-line. In the case of Chefs, this doesn't appear to be necessary, but it can be necessary if the project has @(ProjectReference)s which can't be built in a trimming environment (e.g. .NET Standard projects).

As we don't want $(PublishAot) to be set by default, introduce a $(SkiaPublishAot) "override", a'la unoplatform/uno@92676ea7. $(PublishAot) will be true only if $(SkiaPublishAot)=true.

Additionally, it would be useful to install multiple different builds side-by-side. In order for this to work on iOS (and Android), the different builds must have different $(ApplicationId)s.

Introduce support for the following new MSBuild properties:

  • $(ApplicationIdVendorSuffix): Value to append to $(ApplicationId), so that separate builds have separate names.

  • $(ApplicationTitleVendorSuffix): Value to append to $(ApplicationTitle), so that the different builds are distinguishable on the Home Screen.

This allows 1 2:

git clean -xdf Chefs{,.Api}
dotnet publish -c Release -r ios-arm64 -f net10.0-ios -p:TargetFrameworkOverride=net10.0-ios \
  -bl Chefs/Chefs.csproj -p:UseSkiaRendering=true \
  -p:ApplicationIdVendorSuffix=.mono "-p:ApplicationTitleVendorSuffix= (Mono)" \
  -p:_DeviceName=$UDID "-p:CodesignKey=$CODESIGN_KEY" &&
cp Chefs/bin/Release/net10.0-ios/ios-arm64/publish/Chefs.ipa ../Chefs-monovm.ipa

git clean -xdf Chefs{,.Api}
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:ApplicationIdVendorSuffix=.naot "-p:ApplicationTitleVendorSuffix= (NAOT)" \
  -p:_DeviceName=$UDID "-p:CodesignKey=$CODESIGN_KEY" &&
\cp Chefs/bin/Release/net10.0-ios/ios-arm64/publish/Chefs.ipa ../Chefs-naot.ipa

Then both Chefs-monovm.ipa and Chefs-naot.ipa can be installed at the same time, making it easier to do side-by-side comparisons.

Finally, add a Chefs App Finished Launching message to the end of App.OnLaunched() to provide a primitive way to determine app startup times:

  1. Launch Console.app
  2. Select your target device in the Sources panel on the left
  3. In the Search panel, enter: Process:Chefs
  4. Click the ▶️Start button in the toolbar

On the target device, launch the app.

Back in Console, look for:

  • The first message from Chefs, and
  • The first message containing Chefs App Finished Launching.

Then subtract the timestamps.

GitHub Issue (If applicable): #

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template. (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

Other information

Internal Issue (If applicable):

Footnotes

  1. $UDID from: https://learn.microsoft.com/en-us/dotnet/maui/ios/cli?view=net-maui-10.0#launch-the-app-on-a-device ↩

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

Context: unoplatform/uno#21066
Context: unoplatform/uno@92676ea
Context: https://learn.microsoft.com/en-us/dotnet/maui/deployment/nativeaot?view=net-maui-10.0#publish-using-native-aot

MAUI documentation suggests that the `.csproj` should be modified to
contain `$(PublishAot)` instead of specifying it on the command-line.
In the case of `Chefs`, this doesn't appear to be necessary, but it
can be necessary if the project has `@(ProjectReference)`s which can't
be built in a trimming environment (e.g. .NET Standard projects).

As we *don't* want `$(PublishAot)` to be set by default, introduce a
`$(SkiaPublishAot)` "override", a'la unoplatform/uno@92676ea7.
`$(PublishAot)` will be true *only if* `$(SkiaPublishAot)`=true.

Additionally, it would be useful to install multiple different builds
side-by-side.  In order for this to work on iOS (and Android), the
different builds must have different `$(ApplicationId)`s.

Introduce support for the following new MSBuild properties:

  * `$(ApplicationIdVendorSuffix)`: Value to append to
    `$(ApplicationId)`, so that separate builds have separate names.

  * `$(ApplicationTitleVendorSuffix)`: Value to append to
    `$(ApplicationTitle)`, so that the different builds are
    distinguishable on the Home Screen.

This allows [^0] [^1]:

	git clean -xdf Chefs{,.Api}
	dotnet publish -c Release -r ios-arm64 -f net10.0-ios -p:TargetFrameworkOverride=net10.0-ios \
	  -bl Chefs/Chefs.csproj -p:UseSkiaRendering=true \
	  -p:ApplicationIdVendorSuffix=.mono "-p:ApplicationTitleVendorSuffix= (Mono)" \
	  -p:_DeviceName=$UDID "-p:CodesignKey=$CODESIGN_KEY" &&
	cp Chefs/bin/Release/net10.0-ios/ios-arm64/publish/Chefs.ipa ../Chefs-monovm.ipa

	git clean -xdf Chefs{,.Api}
	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:ApplicationIdVendorSuffix=.naot "-p:ApplicationTitleVendorSuffix= (NAOT)" \
	  -p:_DeviceName=$UDID "-p:CodesignKey=$CODESIGN_KEY" &&
	\cp Chefs/bin/Release/net10.0-ios/ios-arm64/publish/Chefs.ipa ../Chefs-naot.ipa

Then *both* `Chefs-monovm.ipa` *and* `Chefs-naot.ipa` can be
installed *at the same time*, making it easier to do side-by-side
comparisons.

Finally, add a `Chefs App Finished Launching` message to the end of
`App.OnLaunched()` to provide a primitive way to determine app
startup times:

 1. Launch **Console.app**
 2. Select your target device in the Sources panel on the left
 3. In the **Search** panel, enter: `Process:Chefs`
 4. Click the **▶️Start** button in the toolbar

On the target device, launch the app.

Back in Console, look for:

  * The *first* message from Chefs, and
  * The *first* message containing `Chefs App Finished Launching`.

Then subtract the timestamps.

[^0]: `$UDID` from: https://learn.microsoft.com/en-us/dotnet/maui/ios/cli?view=net-maui-10.0#launch-the-app-on-a-device
[^1]: `$CODESIGN_KEY` from: https://learn.microsoft.com/en-us/dotnet/maui/ios/deployment/publish-cli?view=net-maui-10.0
@jonpryor
jonpryor requested a review from kazo0 January 21, 2026 14:13
@jonpryor
jonpryor enabled auto-merge (squash) January 21, 2026 14:53
@jonpryor
jonpryor merged commit e838af9 into main Jan 21, 2026
17 checks passed
@jonpryor
jonpryor deleted the dev/jonpryor/jonp-nativeaot-support branch January 21, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants