Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Provisioning Required for the Simulator?

BrianConradBrianConrad USMember ✭✭✭

I recently took the plunge and added iOS development for my Xamarin apps. An existing app which has shipped for Android and Windows built and runs fine for iOS about 95% only requiring some basic dependency files (Kudos to Xamarin for that). The stumper though has been adding a document picker so my users can import and export data as they do on the other two platforms. I found the Xamarin DocPicker example but it always fails to deploy because of not finding any available provisioning profiles for iOS.

So I created (supposedly) some profiles on the Apple Developer site as in the DocPicker's instructions including the CloudID (those instructions may be a little terse BTW). Seems though that provisioning is for Devices not the simulator if you follow the steps. So why would one be needed for the simulator? What am I missing?

Best Answer

  • BrianConradBrianConrad USMember ✭✭✭
    Accepted Answer

    @YouMockMe said:
    Ah. Ok, well I read something on this about a year ago, but yes you will need to provision and setup entitlements (to correct myself from above) because the logic is that you are connecting into a 'real' system.

    If memory recalls, you need to setup the Test Cloud to mock up the iCloud:
    https://developer.xamarin.com/guides/testcloud/
    https://appcenter.ms/

    I could be wrong, it's been a while. Also my file selector I created was limited to the local device, based on your original statement I thought the entire app itself was failing out not just an iCloud issue. Noting that if you do local device, you can only share documents within your organization not across apps - little fyi

    The short answer is as I suspected though not "distinctly" stated either by Xamarin or even Apple is that Entitlements don't work on the simulator just a real device. Some more searching around revealed some implied info that way including that from Apple Xcode doesn't sign apps for the simulator. I have an iPhone on the way to test on anyway but I hope this helps some folks who are also trying to figure this out.

Answers

  • SirAndriySirAndriy USMember ✭✭✭

    It's because this project include Entitlements.plist (in other words include some apple services), so you need provision to enable it. More information you can find here

  • BrianConradBrianConrad USMember ✭✭✭

    @SirAndriy said:
    It's because this project include Entitlements.plist (in other words include some apple services), so you need provision to enable it. More information you can find here

    Thanks but I did read that too and followed directions. I've also read numerous Stackoverflow posts where people had the same problem as well as other posts here. Some of the examples are from 2016 and even the Apple Developer interfaces have changed. I also think the DocPicker example is a little OTT. Let's have just a basic example of using a file picker that may not require the iCloud entitlement and then we can go from there.

  • YouMockMeYouMockMe USMember ✭✭

    I'm one step ahead of you, literally. Working with Apple is the single most frustrating aspect of all this.

    Not sure where you are in the process. Have you had anything running in an iOS sim yet? It sounds like yes but this new component is causing issues? If not before we get on a roll, let's make sure you've setup Xcode. If you have, then your problem may be the CHECKBOX to automatically provision; it's the single worst BUTTON ever. Nothing is automatic about it. It is actually a really, really, really bad button you have to check and uncheck. If you prevision or change ANYTHING with a certs/provisions....uncheck then check again.

    I created my own file picker/editor and didn't have to worry about the entitlement....I believe that is only for publications, like with Android, in UWP i started out with that option checked so not sure - but then again you cleared that so kudos.

  • BrianConradBrianConrad USMember ✭✭✭

    Not only do I have Xcode all setup (even updated) but also installed VS on the Mac too. My app which is a bit extensive builds and runs but I need to add a document picker to complete it. And yes this will be a published app (already is for Android and Windows). On my Android version users can export and import data to Google Drive and on Windows wherever they want on the computer.

    I updated to VS 15.7.1 and at least the DocPicker example is running. What is exasperating is that the instructions here:
    https://docs.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/manual-provisioning?tabs=vswin#provisioning-an-ios-device-for-development

    Don't work. Following those instructions when it comes to entering UDID I get "Please enter a valid UDID." That is a cut and paste from Xcode for the simulator I'm running!!! I'm sure I'll figure it out somehow and will wander over to Apple's own developer forum to see if this is giving people fits. Maybe there is still a setting wrong. The last time I dealt with Mac development was back in 2000 on an iMac. ;)

  • BrianConradBrianConrad USMember ✭✭✭

    And bringing it back to my original question, this discussion on this forum seems to reinforce the idea that the provisioning should not be required for testing on a simulator.
    https://forums.xamarin.com/discussion/30478/provisioning-problems-for-ios-simulator

    BUT, I get this error on a simulator:

  • YouMockMeYouMockMe USMember ✭✭

    Ah. Ok, well I read something on this about a year ago, but yes you will need to provision and setup entitlements (to correct myself from above) because the logic is that you are connecting into a 'real' system.

    If memory recalls, you need to setup the Test Cloud to mock up the iCloud:
    https://developer.xamarin.com/guides/testcloud/
    https://appcenter.ms/

    I could be wrong, it's been a while. Also my file selector I created was limited to the local device, based on your original statement I thought the entire app itself was failing out not just an iCloud issue. Noting that if you do local device, you can only share documents within your organization not across apps - little fyi

  • BrianConradBrianConrad USMember ✭✭✭
    Accepted Answer

    @YouMockMe said:
    Ah. Ok, well I read something on this about a year ago, but yes you will need to provision and setup entitlements (to correct myself from above) because the logic is that you are connecting into a 'real' system.

    If memory recalls, you need to setup the Test Cloud to mock up the iCloud:
    https://developer.xamarin.com/guides/testcloud/
    https://appcenter.ms/

    I could be wrong, it's been a while. Also my file selector I created was limited to the local device, based on your original statement I thought the entire app itself was failing out not just an iCloud issue. Noting that if you do local device, you can only share documents within your organization not across apps - little fyi

    The short answer is as I suspected though not "distinctly" stated either by Xamarin or even Apple is that Entitlements don't work on the simulator just a real device. Some more searching around revealed some implied info that way including that from Apple Xcode doesn't sign apps for the simulator. I have an iPhone on the way to test on anyway but I hope this helps some folks who are also trying to figure this out.

Sign In or Register to comment.