If you receive the following error message after trying to run an Xamarin application in Visual Studio
"No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com. <YourAppName>"
What this basically means is that you need to create or log into your Apple ID in XCode itself and get a certification straight from Apple.
There is a great article on the Xamarin website on how to do this, check it out here
If you still get the error message, make sure you have the iPhone simulator selected
The following code will get it done in a snap
Context context = RuntimeEnvironment.application.getApplicationContext();
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
You use “RuntimeEnvironment.application.getApplicationContext();” to create an instance of a Context object.
You return the preferences, and modify the needed value and then commit it.
The next time this instance of Context returns SharedPreferences, it will return the version that you modified.
Change as many settings as you need to, then pass the context to the method you are trying to test!