6 Replies
      Latest reply: Sep 1, 2016 5:28 AM by chadbag RSS
      chadbag Level 1 Level 1 (0 points)

        I am trying to create a Mac app that will access CloudKit under the production system.  This is just a helper app I need to run (it runs fine in Xcode against the dwvelopment CloudKit servers) and I won't actually be distributing it to anyone other than me for "beta test" and it won'r ever get to the Mac App Store.

         

        I followed these instructions exactly:

        https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/BetaTestingYourMacApp/BetaTestingYourMacApp.html

        and

        https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/CloudKitQuickStart/TestingYourApp/TestingYourApp.html

         

        But when I try and launch the app, it fails unexpectedly and shows this in the crash dump:

         

        Exception Type:        EXC_CRASH (Code Signature Invalid)

        Exception Codes:       0x0000000000000000, 0x0000000000000000

        Exception Note:        EXC_CORPSE_NOTIFY

         

        Searching on this gives all sorts of answer in the search engines, and many of them point back to the Apple docs above.

         

        I am doing what the Apple doc above says:

         

        Let Xcode create a Mac Developer Certificate and a Team Profile.  Choose "Mac App Store" under the General Tab.  Archive.   Choose option 3 in the export (Export a Developmet Signed Application).  That all happens without error report.  But running it causes the app to crash as shown above.

         

        I also, additionally, tried to create a manual provisioning profile and specify that in the build settings.  That exports fine (showing my manual profile) but it also crashes.

         

        Interestingly, in the developer.apple.com website under my provisioning profiles for Mac OS X, the team profile does not show up at all (to try and verify devices, etc.) but if I add another device, a new team profile is  generated as can be seen in Xcode when downloading all profiles and watching the team one switch to another ID.

         

        Any help or ideas would be appreciated.

        • Re: Creating Beta Mac app for testing CloudKit under Production
          eskimo Apple Staff Apple Staff (6,665 points)

          Prior to macOS 10.12 it’s simply not possible for non-Mac App Store apps to use CloudKit.  Needless to say, this makes beta testing hard.  The best you can do is distribute a Mac App Store development-signed app to a small number of folks (as described in the Distribute Your App Using the Team Provisioning Profile (Mac) section of the CloudKit Quick Start, which you’ve already read).

          We’ve relaxed this restriction in macOS 10.12 but I’m not sure of the exact mechanics.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Creating Beta Mac app for testing CloudKit under Production
              chadbag Level 1 Level 1 (0 points)

              "The best you can do is distribute a Mac App Store development-signed app to a small number of folks (as described in the Distribute Your App Using the Team Provisioning Profile (Mac) section of the CloudKit Quick Start, which you’ve already read)."

               

              Hi. Thanks for the reply.  That is exactly what I am trying to do.  Distribute a Mac App Store development signed app to myself (I am the only one who needs to run it).  But after following the instructions there, it does not seem to run and I am trying to figure out why.   The docs say it should work.

                • Re: Creating Beta Mac app for testing CloudKit under Production
                  eskimo Apple Staff Apple Staff (6,665 points)

                  That is exactly what I am trying to do.  Distribute a Mac App Store development signed app to myself …

                  But you want it to talk to the production CloudKit servers, right?

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"

                    • Re: Creating Beta Mac app for testing CloudKit under Production
                      chadbag Level 1 Level 1 (0 points)

                            "But you want it to talk to the production CloudKit servers, right?"

                       

                      Yes, which is exactly what

                      https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/CloudKitQuickStart/TestingYourApp/TestingYourApp.html

                       

                      says I should be able to do.

                       

                      "Give your CloudKit app a real-world test with multiple simultaneous users by running it on multiple devices using different iCloud accounts. Initially, test your CloudKit app in the development or production environment on designated test devices."

                       

                      (I added the bolding)

                       

                      That says I should be able to specify specific Macs to test which are in the provisioning profile.  And indeed, when I choose the Export, it asks if I want production or development CloudKit servers, with the default being production.  But the app crashes as being incorrectly signed when actually being run.

                       

                      Thanks

                        • Re: Creating Beta Mac app for testing CloudKit under Production
                          eskimo Apple Staff Apple Staff (6,665 points)

                          I am, alas, going to have to back away from this thread.  The key issue here is how CloudKit decides whether to talk to the Production or Development container.  Different frameworks do this in different ways (some use get-task-allow, some put it under your control, some simply have no sandbox, and so on).  I thought I had a reasonable understanding of how this worked for CloudKit but, digging into it today, it’s clear to me that this is more complex than I first thought.  I don’t have the time to continue this research (I don’t actually support CloudKit for DTS), and I’m reluctant to speculate, so I’m going to drop this. Sorry.

                          My recommendation is that you repost your question over in System Frameworks > CloudKit and iCloud Drive to see if anyone over there has direct experience with this.  If you strike out there, you should open a DTS tech support incident and one of my colleagues will be able to help you out.

                          Share and Enjoy

                          Quinn “The Eskimo!”
                          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                          let myEmail = "eskimo" + "1" + "@apple.com"