Debugging provisioning profiles on the command line

Raise your hand if you’ve ever struggled with getting your app’s bundle identifier, info.plist, and entitlements.plist to match up with your provisioning profile.

I tried to explain provisioning profiles using the ten-hundred most common words, but in slightly-less-common words, a development prov-pro associates: A team, a developer, an application identifier, privacy and security entitlements, and development devices.

While there’s no silver bullet, there is a way to dump the contents of a provisioning profile into a readable plist format. From the command-line, run:

security cms -D -i some.mobileprovision

Here, for instance, is the output of a provisioning profile for an app that uses SiriKit to trigger a workout:

napkin

As you can see, this is a convenient way to confirm the associations in the prov-pro, particularly entitlements, the app ID, and provisioned devices.

Mysterious crashes in your iOS 10 program? Check your info.plist

If you’re developing for iOS 10 and your app “silently” crashes (especially if it’s an older app), the culprit could well be the increased privacy requirements in iOS 10. Namepaces such as HomeKit now require specific privacy-related keys to be in your info.plist (for instance, NSHomeKitUsageDescription). If you don’t have them, the system automatically closes your application without an exception or Console.log message (if you run in the simulator, you may see a PRIVACY_VIOLATION notice in the stack trace).