-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggested update to the MAUI Docs on publishing #681
Comments
From @rolfbjarne on Tue, 28 Jun 2022 17:16:02 GMT The first one fails because we need to know the runtime identifier very early in the build process, and at that point we don't know whether we're building or publishing, and we default to a simulator runtime identifier, since that's the most common use case. The second one fails due to NuGet/Home#11653. You should be able to work around this by adding something like this in the project file: <PropertyGroup Condition="'$(IsPublishing)' == 'true' And '$(TargetFramework)' == 'net6.0-ios'">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
</PropertyGroup> and then
|
From @dansiegel on Tue, 28 Jun 2022 17:38:51 GMT Might I suggest an update to the MAUI Docs on publishing |
From @dansiegel on Tue, 28 Jun 2022 17:42:24 GMT This does seem to resolve the issue however I am only seeing the IPA in the publish directory. Is there a flag we can pass to get the dSYM? |
From @rolfbjarne on Wed, 29 Jun 2022 10:27:38 GMT @dansiegel try passing |
From @dansiegel on Thu, 30 Jun 2022 20:09:20 GMT I've updated csproj to automatically set the Runtime based on TargetFramework & Configuration. Then adding the parameter you mentioned I end up with: dotnet publish -f:net6.0-ios -c Release /p:ArchiveOnBuild=true \
/p:ApplicationDisplayVersion=0.1.0 /p:ApplicationVersion=15 \
-o ~/repos/demo/MauiCIDemo/publish /p:NoDSymUtil=false This doesn't seem to make any difference. This results in the default behavior where the dSYM is generated it's just in
What I would expect to see is the dSYM in the same publish directory as the IPA. |
From @rolfbjarne on Thu, 30 Jun 2022 21:42:09 GMT Ah yes, we put the .dSYM next to the .app we build, and then we don't move/copy it elsewhere after that. It should be easy enough to copy it to the publish directory too. |
From @rolfbjarne on Thu, 30 Jun 2022 21:59:17 GMT I've created an enhancement request for this: xamarin/xamarin-macios#15384 (to avoid conflating multiple problems in a single issue here). |
From @rolfbjarne on Thu, 30 Jun 2022 21:59:44 GMT
Could you link me to the exact document you read to make sure we're updating the right one? |
From @dansiegel on Fri, 01 Jul 2022 16:04:51 GMT @rolfbjarne makes perfect sense to move the dSYM request to its own issue...
https://docs.microsoft.com/en-us/dotnet/maui/ios/deployment/overview#publish A few issues I have with the publishing docs..
|
From @rolfbjarne on Mon, 04 Jul 2022 11:24:11 GMT Ok, that doc is stored here: https://github.com/dotnet/docs-maui/blob/main/docs/ios/deployment/overview.md#publish |
Hi @dansiegel Is this specific comment the issue related to docs? #681 (comment) It's hard to read through everything and completely understand what work is being requested 😁 |
Sounds a bit like the condition of the docs 😆... sorry this is gonna be long. Please feel free to ask any questions, also more than happy to jump on a teams call if it would help. Seriously though when it comes to publishing an iOS app the docs don't provide a coherent story to begin with, and ultimately lack the critical information that someone needs if they are looking at publishing a net6+ iOS app. One of the big problems in the docs currently is that they provide confusing information that is really for an edge case that probably needs its own docs rather than being the central focus. Or at the very least need some sort of segregation like we see in the Essentials docs where things get split out by platform. It is clear that when the publishing docs were written, they were written by someone working on a PC connecting to a remote mac host. While that's a legitimate (though likely very rare) edge case scenario, for someone looking to publish this needs to be clear from the perspective of Because of all of the fluff about building on Windows and connecting to a remote Mac and all of the "notes" that go along with it, it distracts from the information people need when deciding what parameters they might actually need to pass CRITICAL MISSING/WRONG INFORMATIONCurrently buried in Add code signing data to your app project is an example showing that
The problem is as discussed in the original thread xamarin/xamarin-macios#15365, this just simply doesn't work as the RuntimeIdentifier must absolutely be specified in your csproj or some other .props file. Which makes the information in the existing Publish docs just plain false. What's Needed
Hope that helps. |
Thank you for the feedback. The .NET CLI is supposed to be able to set all of those properties, such as the As to the reason it's still Windows-focused, is that the tooling for macOS hasn't been fully ready for a full end-to-end create-an-app-in-mac-publish-on-mac. It seems that the VS for Mac 17.3 preview release will be the official version to support MAUI apps directly. However, that preview started a month after the GA of .NET MAUI, being 2 months ago, and we're still playing catch up to preview releases and service releases, etc. And yeah, we need to do more of "do it all via CLI (signing/provisioning) and also the IDE" Anyway, thank you for the feedback on the article, it will help us get it sorted. Tagging @davidbritch for priority |
It's perfectly possible to set the RuntimeIdentifier on the command line. What I said was that if you don't set a RuntimeIdentifer (either on the command line or in the csproj), we'll default to a simulator RuntimeIdentifier, because:
To make things worse, passing the RuntimeIdentifier on the command line is likely to run into this problem if there are multiple target frameworks in the project file: dotnet/sdk#21877 Taking into account both of these problems, a solution I came up with was to add this to the project file: <PropertyGroup Condition="'$(IsPublishing)' == 'true' And '$(TargetFramework)' == 'net6.0-ios'">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
</PropertyGroup> and then publish like this: $ dotnet publish -f:net6.0-ios /p:IsPublishing=true ... of course this could be done with configurations instead: <PropertyGroup Condition="'$(Configuration)' == 'Release' And '$(TargetFramework)' == 'net6.0-ios'">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
</PropertyGroup> and then publish like this: $ dotnet publish -f:net6.0-ios -c Release ... Either way works, it's just a matter of taste (and there are probably other ways to do the same thing too). |
A few things to note here... When it comes to the docs I think we can safely say someone who is looking for docs on publishing cares about generating an IPA to potentially ship to the store or for internal use and not the Simulator. Given that... if the behavior was that it builds by default for the simulator this would need to be noted and documented how to build for the device in the docs... That said my actual experience is that specifying the runtime in the CLI arguments does NOT work. @rolfbjarne please go back and look at the initial comment and you will notice that running either of the following
Resulted in this error
Whether by design or bug, currently you MUST supply the RuntimeIdentifier via build props or in the csproj. Everything else including the |
From @dansiegel on Tue, 28 Jun 2022 15:50:53 GMT
Steps to Reproduce
This is running the publish from the MacOS Terminal
dotnet publish -f:net6.0-ios -c Debug /p:ArchiveOnBuild=true /p:ApplicationDisplayVersion=0.1.0 /p:ApplicationVersion=15 -o ~/repos/demo/MauiCIDemo/publish
dotnet publish -f:net6.0-ios -c Debug /p:ArchiveOnBuild=true /p:ApplicationDisplayVersion=0.1.0 /p:ApplicationVersion=15 -o ~/repos/demo/MauiCIDemo/publish -r ios-arm64
(also tried with/p:RuntimeIdentifier=ios-arm64
which had the same result)Expected Behavior
The first command should work... The second command should have resolved the error encountered on the first.
Actual Behavior
After running the first command:
After running the second command:
You'll notice btw that while the first error comes out of the
Microsoft.iOS.Sdk
, specifying theios-arm64
runtime actually picks up theMicrosoft.MacCatalyst.Sdk
which is what throws the error for an unrecognized runtime.Environment
dansiegel@dans-mbp MauiCIDemo % dotnet --version 6.0.301 dansiegel@dans-mbp MauiCIDemo % dotnet workload list Installed Workload Ids Installation Source ----------------------------------------------- wasm-tools SDK 6.0.300 macos SDK 6.0.300 maui-tizen SDK 6.0.300 maui-maccatalyst SDK 6.0.300 maui-ios SDK 6.0.300 maui-android SDK 6.0.300 ios SDK 6.0.300 maccatalyst SDK 6.0.300 maui SDK 6.0.300 tvos SDK 6.0.300 tizen SDK 6.0.300 android SDK 6.0.300 Use `dotnet workload search` to find additional workloads to install.
Build Logs
See above
Example Project (If Possible)
Copied from original issue xamarin/xamarin-macios#15365
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 57839
The text was updated successfully, but these errors were encountered: