I'm building a music-recognition app for the Mac App Store that uses ShazamKit (SHSession / SHManagedSession) against the default Shazam catalog. In a sandboxed build, SHSession.match(_:) fails with:
com.apple.ShazamKit error 202 — "The connection to service named com.apple.shazamd was invalidated"
The root cause is a sandbox denial of the mach-lookup to the ShazamKit matching daemon:
kernel (Sandbox): deny(1) mach-lookup com.apple.shazamd
What I've established:
-
Enabling the ShazamKit App Service on the App ID does not add com.apple.shazamd to the sandbox mach-lookup allow-list on macOS — the denial persists and matching returns error 202.
-
The iOS entitlement com.apple.developer.shazamkit is rejected by the macOS validator at upload ("not supported on macOS"), so it isn't an option here.
-
Adding com.apple.security.temporary-exception.mach-lookup.global-name = [com.apple.shazamd] to the app's entitlements removes the denial, and ShazamKit then matches correctly under the sandbox (verified end-to-end: real api.shazam.apple.com/v1/catalog/.../match requests complete and tracks are identified). Removing that exception reproduces error 202 on every probe.
So the temporary-exception appears to be the only way to make ShazamKit's default-catalog matching work inside the macOS App Sandbox today.
Questions:
-
Is there a sanctioned, non-temporary-exception way to use ShazamKit default-catalog matching in a sandboxed macOS app (a proper entitlement, an App Service configuration, or a supported API usage)? If not, is the com.apple.shazamd mach-lookup temporary-exception the intended approach on macOS?
-
My actual SHSession.match runs in a nested helper that inherits the app's sandbox (com.apple.security.inherit). Is it correct to place the exception on the main app (which the inherited helper then picks up), rather than on the helper itself?
Environment: macOS 26.1, ShazamKit App Service enabled on the App ID, signed App Sandbox build installed via TestFlight (valid _MASReceipt present). Happy to share entitlement plists and a focused sample on request. Thanks!
I ran a set of controls to answer your question
Nice!
I’m not 100% sure why this is failing, but I want to explain a little bit about how App Sandbox works, so that you can understand why I’m asking my next question.
When it comes to Mach service lookup, App Sandbox applies a clever trick to ensure that your app can only access its expected services. Let’s look at ShazamKit as example of this. Normally an app can’t access the com.apple.shazamd Mach service because the App Sandbox blocks such lookups by default. However, if the app links to the ShazamKit framework, App Sandbox extends its sandbox to allow that lookup.
Your tests indicate that this extension isn’t working for a spawn subprocess. Before I send you off to file a bug, I’d like to confirm one thing. You wrote:
2- The same binary … spawned as a child of that same sandboxed parent …
So, just to be clear, this executable includes a static import of ShazamKit. That is, if your run this command over the executable:
% otool -L /path/to/your/executable
then ShazamKit shows up as an imported framework. Right?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"