.NET MAUI iOS在启用钥匙串共享权限后无法部署到iOS模拟器。

huangapple go评论101阅读模式
英文:

.NET MAUI iOS won't deploy to iOS simulator once Keychain Sharing Entitlement is enabled

问题

我正在开发一个.NET MAUI应用程序,需要使用SecureStorage API存储访问令牌。我按照Microsoft文档中的指南 添加了Keychain Entitlement,以便在iOS模拟器上部署应用程序。

然而,一旦启用了Entitlement,如果我尝试从Visual Studio for Mac运行应用程序,就会出现以下错误:Could not find any available provisioning for MauiApp on iOS

尽管错误消息很清楚,但我无法找到关于如何解决这个问题的明确信息。

英文:

I'm developing a .NET MAUI application and I need to store an access token using the SecureStorage API. I followed this guide from the Microsoft Documentation which states that the Keychain Entitlement should be added when deploying to the iOS simulator.

However, once the Entitlement is enabled if I try to run the app from Visual Studio for Mac I get the following error: Could not find any available provisioning for MauiApp on iOS.

Despite the error message is clear, I am not able to find any clear information about what am I supposed to do in order to solve this problem.

答案1

得分: 1

以下是翻译好的部分:

由于您没有苹果开发者帐户,您可以使用XCode来申请免费的配置文件。您可以参考免费配置文件适用于Xamarin.iOS应用程序(对于MAUI也适用,但有一些差异)。

总结一下,以下是步骤:

  1. 使用Xcode创建签名标识和配置文件

使用任何您想要的Bundle标识符创建一个XCode项目。启用“自动管理签名”。如果没有其他帐户,则选择您的个人团队。然后XCode将为您创建配置文件。

  1. 部署您的Maui应用程序

Maui项目的Bundle标识符应与您刚刚创建的XCode项目的Bundle标识符相同。还选择由XCode创建的配置文件。

然后您可以运行您的Maui项目。

希望它有效。

英文:

Since you don't have a Apple Dev account, you could use XCode to apply free provisioning. You could refer to Free provisioning for Xamarin.iOS apps(also works for MAUI but with a little difference).

To conclude, there are following steps:

1.Use Xcode to create a signing identity and provisioning profile

Create a XCode project with any Bundle Identifier you want. Enable Automatically manage signing. Select your Personal team if don't have other accounts. Then XCode will create the provisioning file for you.

2.Deploy your Maui app

Bundle Identifier of Maui project should be identical to the Bundle ID of XCode project you just created. Also select the provisioning file created by XCode.

Then you could run your Maui project.

Hope it works.

huangapple
  • 本文由 发表于 2023年5月11日 09:15:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76223511.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定