You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/deploying/native-aot/ios-like-platforms/index.md
+22-15Lines changed: 22 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,19 +8,20 @@ ms.date: 11/21/2024
8
8
9
9
# Native AOT support for iOS-like platforms
10
10
11
-
Starting from .NET 8, Native AOT supports targeting iOS-like platforms. The term **iOS-like platforms** refers to Apple platforms that use similar APIs such as: iOS, MacCatalyst and tvOS.
11
+
Starting from .NET 8, Native AOT supports targeting iOS-like platforms. The term *iOS-like platforms* refers to Apple platforms that use similar APIs such as: iOS, MacCatalyst and tvOS.
12
12
13
13
In the first release, the support was experimental, while in .NET 9 these platforms received full support with Native AOT.
14
14
15
15
Based on the use case, the support can be divided into:
16
16
17
-
- support for assemblies referencing OS-specific APIs through .NET mobile workloads (like: .NET MAUI apps)
18
-
- support for assemblies without OS-specific API dependencies
17
+
- support for applications and libraries without OS-specific API dependencies
18
+
- support for applications and libraries referencing OS-specific APIs
19
19
20
-
The former is a more common scenario and is described in detail in [How MAUI supports Native AOT](/dotnet/maui/deployment/nativeaot).
21
-
For the latter use case Native AOT deployment can be achieved by:
20
+
## Support for applications and libraries without OS-specific API dependencies
22
21
23
-
1. Enable Native AOT deployment by including the following properties in the project file:
22
+
This refers to .NET projects targeting the general or non-OS-specific target framework (like: `net9.0`), for which Native AOT can be enabled in the following way:
23
+
24
+
1. Include the following properties in your project file:
24
25
25
26
```xml
26
27
<PublishAot>true</PublishAot>
@@ -29,16 +30,22 @@ For the latter use case Native AOT deployment can be achieved by:
29
30
30
31
2. Publish the project for the desired iOS-like target platform by specifying adequate runtime identifier (later referred to as `<rid>`):
31
32
32
-
- `ios-arm64`, for iOS physical devices
33
-
- `iossimulator-arm64` or `iossimulator-x64`, for iOS simulators
34
-
- `maccatalyst-arm64` or `maccatalyst-x64`, for Mac Catalyst
35
-
- `tvos-arm64`, for tvOS physical devices
36
-
- `tvossimulator-arm64` or `tvossimulator-x64`, for tvOS simulators
33
+
- `ios-arm64`, for iOS physical devices
34
+
- `iossimulator-arm64` or `iossimulator-x64`, for iOS simulators
35
+
- `maccatalyst-arm64` or `maccatalyst-x64`, for Mac Catalyst
36
+
- `tvos-arm64`, for tvOS physical devices
37
+
- `tvossimulator-arm64` or `tvossimulator-x64`, for tvOS simulators
37
38
38
-
and execute the following command:
39
+
and execute the following command:
39
40
40
-
```
41
-
dotnet publish -r <rid>
42
-
```
41
+
```
42
+
dotnet publish -r <rid>
43
+
```
43
44
44
45
For specifics of building and consuming native libraries on iOS-like platforms, see [How to create and consume custom frameworks with Native AOT for iOS-like platforms](./creating-and-consuming-custom-frameworks.md).
46
+
47
+
## Support for applications and libraries referencing OS-specific APIs
48
+
49
+
This refers to .NET MAUI projects targeting OS-specific target frameworks (like: `net9.0-ios`).
50
+
51
+
How Native AOT can be enabled for .NET MAUI apps, see [Native AOT deployment on iOS and Mac Catalyst](/dotnet/maui/deployment/nativeaot).
0 commit comments