I'm a hobbyist and I'm trying to convert a shell script into a compiled MacOS SwiftUI app. It requires running a third party utility that I placed in /usr/local/bin.
I found example code on the web that runs the /usr/bin/say command. It works just fine, but when I modify it to try to run the utility in /usr/local/bin, I receive a file does not exist error.
Assuming it was some sort of permissions problem, I modified the permissions on /usr/local/bin to 777, and still get the error. I searched in the Mac's Security and Privacy and added Xcode to the Developer Tools to allow it run run software that does not meet the system's security policy. Nope. I've even copied the /usr/bin/say command over to /usr/bin/local and get the same error.
I get the error on both the latest Big Sur Xcode and on the latest beta Monterey and Xcode beta.
Could someone please point me the docs that explain what is happening here? Thanks.
Here's the error that I'm getting: SayThis/ContentView.swift:38: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=4 "The file “say” doesn’t exist." UserInfo={NSFilePath=/usr/local/bin/say}
(lldb)