Operation not permitted when executing 'killall' with Swift

前端 未结 2 741
独厮守ぢ
独厮守ぢ 2020-12-19 21:59

I\'m trying to create a menu bar app to hide desktop icons and hopefully various other things mostly to learn more about Swift, and for some reason I can\'t get it to work.

相关标签:
2条回答
  • 2020-12-19 22:18

    If you're creating it as a local app for yourself you can open your entitlements file and change "App Sandbox" to NO. I would not recommend doing that for a production app.

    0 讨论(0)
  • 2020-12-19 22:22

    Mac apps, like iOS apps, are sandboxed by default, which means they have very limited access to system resources. They are only allowed to read and write to a small number of sandboxed directories, for example, and read/write/execute from usr/bin is most definitely not allowed, and nor will you be allowed to launch processes.

    As I recall, by deleting your entitlements file you are building an app that isn't sandboxed. You can run it from Xcode, but will need to change your system settings in order to be able to run it from the finder.

    0 讨论(0)
提交回复
热议问题