I'm trying to debug a simple new Xamarin.Forms application on the IPhoneSimulator. I'm using Windows, and I'm paired to a macbook in my network.
The Xamarin.Forms template runs fine, but when I'm calling the Xamarin.Essentials.SecureStorage
API
var timer = new Timer(5000);
timer.Elapsed += async (sender, e) => {
timer.Stop();
await SecureStorage.SetAsync("message", "Hello world");
};
I'm getting the following error:
System.Exception: Error adding record: MissingEntitlement
So I edit my Entitlements.plist and enabled the KeyChain
entitlement. Tried to debug again, still the same error. So I go to project properties > iOS Bundle Signing and set the Custom entitlements
to my Entitlements.plist. This somehow switches the scheme to Manual Provisioning.
Could not find any available provisioning profiles for MyApplication.iOS on iOS
So I did what this answer said: https://stackoverflow.com/a/51615262/8941307. Now I'm still getting the MissingEntitlement exception.
When I remove the Custom Entitlements and switch back to Automatic Provisioning, I'm able to run the app again, but off course without the SecureStorage.
Do I need to have a $ 99 subscription to test these features like SecureStorage on the IPhoneSimulator? Would this work when using a physical iPhone?
EDIT
I'm able to debug the sample project from XCode from my macbook on my iPad (physical), but apparently I can't get it working with Visual Studio for Mac on my iPad. I'm getting the following error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3): Error: Could not find any available provisioning profiles for Helloworld.iOS on iOS.
What am I still missing in VSMac? Also I already trusted my developer account on my iPad, hence why I'm able to run the sample from XCode.
I've used XCode 12.1, located at /Applications/Xcode.app