diff --git a/docs/includes/dotnet-publish-net8-ios.md b/docs/includes/dotnet-publish-net8-ios.md new file mode 100644 index 000000000..b2c6e5e45 --- /dev/null +++ b/docs/includes/dotnet-publish-net8-ios.md @@ -0,0 +1,7 @@ +--- +ms.topic: include +ms.date: 11/13/2023 +--- + +> [!NOTE] +> In .NET 8, the `dotnet publish` command defaults to the `Release` configuration. Therefore, the build configuration can be omitted from the command line. In addition, the `dotnet publish` command also defaults to the `ios-arm64` `RuntimeIdentifier`. Therefore, the `RuntimeIdentifier` can also be omitted from the command line. diff --git a/docs/ios/deployment/publish-cli.md b/docs/ios/deployment/publish-cli.md index 9e96b1f38..c32369ff1 100644 --- a/docs/ios/deployment/publish-cli.md +++ b/docs/ios/deployment/publish-cli.md @@ -47,7 +47,7 @@ For example, use the following command to build and sign an *.ipa* on a Mac: dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: John Smith (AY2GDE9QM7)" -p:CodesignProvision="MyMauiApp" ``` -[!INCLUDE [dotnet publish in .NET 8](~/includes/dotnet-publish-net8.md)] +[!INCLUDE [dotnet publish in .NET 8 on iOS](~/includes/dotnet-publish-net8-ios.md)] Publishing builds and signs the app, and then copies the *.ipa* to the *bin/Release/net8.0-ios/ios-arm64/publish/* folder. The distribution channel for the app is specified in the distribution certificate contained within the provisioning profile. For information about creating provisioning profiles for the different distribution channels, see [Publish an iOS app for App Store distribution](publish-app-store.md), [Publish an iOS app for ad-hoc distribution](publish-ad-hoc.md), and [Publish an iOS app for in-house distribution](publish-in-house.md). @@ -55,6 +55,8 @@ For more information about the `dotnet publish` command, see [dotnet publish](/d +::: moniker range="=net-maui-7.0" + ## Runtime identifiers If the `RuntimeIdentifier` parameter isn't specified on the command line, or in the project file, the build process will default to a simulator runtime identifier. In addition, passing the runtime identifier on the command line can result in the build failing to restore if there are multiple target frameworks in the project file. For more information, see [Specifying both -f and -r to dotnet build fails to restore if multiple frameworks are present in the project file](https://github.com/dotnet/sdk/issues/21877). @@ -62,7 +64,7 @@ If the `RuntimeIdentifier` parameter isn't specified on the command line, or in One solution to these issues is to add the following `` to your project file: ```xml - + ios-arm64 ``` @@ -70,13 +72,13 @@ One solution to these issues is to add the following `` to your p Then, use the following command to publish your app: ```dotnetcli -dotnet publish -f net8.0-ios -p:IsPublishing=true ... +dotnet publish -f net7.0-ios -p:IsPublishing=true ... ``` An alternative solution to these issues is to add the following `` to your project file: ```xml - + ios-arm64 ``` @@ -84,9 +86,11 @@ An alternative solution to these issues is to add the following ` Then, use the following command to publish your app: ```dotnetcli -dotnet publish -f net8.0-ios -c Release ... +dotnet publish -f net7.0-ios -c Release ... ``` +::: moniker-end + ## Define build properties in your project file An alternative to specifying build parameters on the command line is to specify them in your project file in a ``. The following table lists some of the common build properties: @@ -97,7 +101,7 @@ An alternative to specifying build parameters on the command line is to specify | `` | The unique identifier for the app, such as `com.companyname.mymauiapp`. | | `` | The version of the build that identifies an iteration of the app. | | `` | The version number of the app. | -| `` | The runtime identifier (RID) for the project. Set to `ios-arm64`. | +| `` | The runtime identifier (RID) for the project. Use `ios-arm64`. | | `` | A boolean value that indicates whether to produce the app archive. Use `true` to produce the *.ipa*. | | `` | The name of the code signing key. | | `` | The provisioning profile to use when signing the app bundle. | @@ -112,7 +116,7 @@ The following example shows a typical property group for building and signing yo ```xml - ios-arm64 + ios-arm64 Apple Distribution: John Smith (AY2GDE9QM7) MyMauiApp true @@ -152,6 +156,8 @@ For example, use the following command to build and sign an *.ipa* from Windows: dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: John Smith (AY2GDE9QM7)" -p:CodesignProvision="MyMauiApp" -p:ServerAddress={macOS build host IP address} -p:ServerUser={macOS username} -p:ServerPassword={macOS password} -p:TcpPort=58181 -p:_DotNetRootRemoteDirectory=/Users/{macOS username}/Library/Caches/Xamarin/XMA/SDKs/dotnet/ ``` +[!INCLUDE [dotnet publish in .NET 8 on iOS](~/includes/dotnet-publish-net8-ios.md)] + > [!NOTE] > If the `ServerPassword` parameter is omitted from a command line build invocation, Pair to Mac attempts to log in to the Mac build host using its saved SSH keys.