How do I test a Mac App Store app that uses MapKit?

My app uses MapKit, so Xcode 8 insists I have a provisioning profile. This seems to make it impossible to test the Mac App Store version of my app the way I used to with Xcode 7.


With Xcode 7 I could build the MAS version, launch it, and my app would detect there wasn't a valid MAS receipt, exiting with -173. This would cause the OS to put up a login dialog and I could enter a test account and password registered with iTuneConnect. A MAS receipt would then be added to my app and I could launch it after that and test it.


With Xcode 8, my app won't even launch. This error is printed to the system log:


Oct 30 13:30:56 com.apple.xpc.launchd[1] (com.mycompany.myapp[54628]): Binary is improperly signed.


When I type codesign -vv into Terminal, my app is "valid on disk" and "satisfies its Designated Requirement".


I think the problem is the binary is signed with my "3rd Party Developer Application" certificate, and the provisioning profile that allows MapKit access wants the binary to be signed by Apple. So it's impossible for me to launch the MAS build.


What am I doing wrong? How can I test my Mac App Store build?

In case anyone else runs into this problem, there is a way to test the MAS build:


1. turn off any codesigning checks in your app that verify the signing certificate

2. follow the instructions in this tech note under "Test the Exact Build You Release"


https://developer.apple.com/library/content/qa/qa1778/_index.html

Note that Apple's hack to resign the app for testing does not work for login items embedded within the app. Those will not be resigned and will not run. See radar 29248794.

I was told in response to my radar that the tech note referenced is woefully out of date and the producure described does NOT test the MAS version of your app. So the question remains open unfortunately...

How do I test a Mac App Store app that uses MapKit?
 
 
Q