Skip to content

Make it possible to choose a different default RuntimeIdentifier between build and publish for SDKs #27253

@rolfbjarne

Description

@rolfbjarne

Is your feature request related to a problem? Please describe.

For the Apple mobile SDKs (iOS, tvOS), the SDK selects a default RuntimeIdentifier for projects that don't specify one.

The default RuntimeIdentifier is a runtime identifier that targets the simulator, because that's the most common build target (developers debug more in the simulator than on device):

https://github.com/xamarin/xamarin-macios/blob/b1cb5f62b7cde5181c41df750b1b59fa7f2f0762/dotnet/targets/Xamarin.Shared.Sdk.props#L48-L49

However, when publishing, the simulator runtime identifier is always the wrong choice. Unfortunately, by the time we know the user wants to publish, it's too late to set the RuntimeIdentifier, and as such we're left with one choice: detect that the user didn't specify a runtime identifier, and show an error telling them to specify one:

https://github.com/xamarin/xamarin-macios/blob/b1cb5f62b7cde5181c41df750b1b59fa7f2f0762/dotnet/targets/Xamarin.Shared.Sdk.Publish.targets#L13-L19

This is not really a good user experience, ideally we'd be able to select a different runtime identifier when publishing (for tvOS there's only one valid runtime identifier for publishing, so we'll be correct 100% of the time, and for iOS we'd be right at least 99.9% if the time).

Ref: #26444 (comment)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions