Search code examples
xamarinxamarin.iosios-simulatorkeychainprovisioning-profile

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


I have troubles with saving an account credentials inside an IPhoneSimulator's Keychain. I cannot use AccountSaver.Create().Save(credentials, "app") without Entitlements.plist. However when I add it to my project, compilation error shows up:

Could not find any available provisioning profiles for iOS.

I've added iOS Development certifcate to my account on Mac and tried to create a free provisioning profile but failed due to a lack of IPhone device. Suprisingly, when I tried to build dummy project with added Keychain to Entitlements inside Xcode on my Mac and run it on a simulator no compilation errors occured.

My questions are: Do I have to make Apple Developer Account to test my Xamarin.iOS app inside IPhoneSimulator or is it possible without it and I'm doing something wrong? If so, what should I do to be able to compile my app?

I use Visual Studio 2017 on Windows 8 connected to a Mac Agent (Mac Mini).

P.S.: Most posts states, that simulator doesn't need provisioning profile, but according to 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


Solution

  • Some time has passed since I asked this question, but I think it deserves an answer not only in the comments. As @wottle wrote it is required to be enrolled i Apple Developer Program in order to have access to Keychain. I sugest also to use Xamarin.Essentials' SecureStore instead of AccountSaver.