# Running external binaries from Swift Package (TTS engine): Operation not permitted from Xcode app

**URL:** <https://forums.swift.org/t/running-external-binaries-from-swift-package-tts-engine-operation-not-permitted-from-xcode-app/80982>\
**Category:** C++ interoperability\
**Created:** [July 8, 2025, 1:08pm UTC](https://forums.swift.org/t/running-external-binaries-from-swift-package-tts-engine-operation-not-permitted-from-xcode-app/80982 "2025-07-08T13:08:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atrusplus](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Atrusplus](https://forums.swift.org/u/Atrusplus)\
**Post date:** [July 8, 2025, 1:08pm UTC](https://forums.swift.org/t/running-external-binaries-from-swift-package-tts-engine-operation-not-permitted-from-xcode-app/80982/1 "2025-07-08T13:08:26Z")

</div>

Hi everyone,  
We’re developing a macOS SwiftUI app that uses a local Swift Package (`CasSherpaCore`) to invoke an external compiled binary (`sherpa-onnx-offline-tts`) for text-to-speech synthesis using system calls. The package works flawlessly when tested from terminal or via a lightweight test C program.

However, when we invoke it from a SwiftUI app (even with Full Disk Access granted to Xcode and Terminal), we consistently get the error:

```swift
sh: /Users/xxxxxxxxxxx/SherpaONNX/sherpa-onnx/build/bin/sherpa-onnx-offline-tts: Operation not permitted

```

We’ve tried:

- Granting Full Disk Access to Xcode and Terminal.
- Removing the quarantine flag with `xattr -d com.apple.quarantine`.
- Setting executable permission via `chmod +x`.
- Using both `system()` and `Process` in C and Swift contexts.
- Testing within a Swift Package that’s integrated into the app as a local dependency.
- Running the command manually from terminal (works perfectly).

It appears that macOS (or Xcode’s runtime sandbox) is restricting execution of binaries from certain locations or contexts when launched via `system()` inside the app.

**Questions:**

1. Is there a specific entitlement or configuration that allows execution of local binaries from a SwiftUI macOS app?
2. Is this related to System Integrity Protection (SIP) or a hardened runtime limitation?
3. Are there best practices or alternative approaches to safely execute local TTS binaries from within a Swift app?

Any help would be deeply appreciated. This is a core feature in our project and we’re stuck at this point. Thank you so much in advance!

---

<div class="post-metadata">

**Author:** ![eskimo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/eskimo/32/13558_2.png) [@eskimo](https://forums.swift.org/u/eskimo)\
**Post date:** [July 9, 2025, 7:40am UTC](https://forums.swift.org/t/running-external-binaries-from-swift-package-tts-engine-operation-not-permitted-from-xcode-app/80982/2 "2025-07-09T07:40:40Z")

</div>

This is almost certainly the App Sandbox in play. App Sandbox is _very_ specific to Apple platforms, indeed to macOS, and thus somewhat off topic for Swift Forums.

Are you planning to ship this app on the Mac App Store? If not, my advice is that you disable App Sandbox and move on with your day.

OTOH, if you do eventually plan to ship your app on the App Store then we should talk about your issue in more depth, and it’d be better to do that over on [Apple Developer Forums](https://developer.apple.com/forums/). If you start a thread over there, put it in the [App & System Services \> Processes & Concurrency](https://developer.apple.com/forums/topics/app-and-system-services/processes-and-concurrency) topic area and tag it with _App Sandbox_. That way I’ll be sure to see it go by.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple
