Xamarin.iOS - 使用带有免费 iOS 开发证书的 iPhoneSimulator 钥匙串

Xamarin.iOS - Using IPhoneSimulator's Keychain with a free iOS Development certificate

我无法在 IPhone模拟器的钥匙串中保存帐户凭据。如果没有 Entitlements.plist,我无法使用 AccountSaver.Create().Save(credentials, "app")。但是,当我将它添加到我的项目时,出现编译错误:

Could not find any available provisioning profiles for iOS.

我已将 iOS 开发证书添加到我在 Mac 上的帐户,并尝试创建免费配置文件,但由于缺少 IPhone 设备而失败。 令人惊讶的是,当我尝试在我的 Mac 和 运行 上的 Xcode 内的 Entitlements 中添加钥匙串来构建虚拟项目时,它在模拟器上没有发生编译错误。

我的问题是:我是否必须创建 Apple Developer Account 才能在 IPhoneSimulator 中测试我的 Xamarin.iOS 应用程序,或者没有它是否可能,我正在做一些事情错误的?如果是这样,我应该怎么做才能编译我的应用程序?

我在 Windows 8 上使用 Visual Studio 2017 连接到 Mac Agent(Mac Mini)。

P.S.: 大多数帖子指出,模拟器不需要配置文件,但根据 this thread:

Starting with Xamarin.iOS 8.10, if the Entitlements.plist file is set at all for the iPhoneSimulator build configuration, then codesigning is required and thus an iOS code signing certificate is required to be installed in your keychain. ~ Xamarin Forum

自从我提出这个问题以来已经过去了一段时间,但我认为它不仅在评论中值得回答。 正如@wottle 所写,需要在 Apple Developer Program 中注册才能访问 Keychain。 我还建议使用 Xamarin.Essentials' SecureStore 而不是 AccountSaver。

我们有一堆 Apple Store 应用程序的 Apple Distribution 配置文件已过期。一旦我们重新生成 Apple 分发证书并为受影响的应用程序创建新的分发配置文件,问题就消失了。