“Operation not permitted” when execute shell scrip

2019-08-05 05:52发布

问题:

I'm developing the mac applivation on Xcode, I want to execute some shell script,

cp file ~/Library/.....

It always show "Operation not permitted",but I'm sure that it can be execute at terminal.

I'm trying to edit the "Install Owner" and "Install Permissions" inside the Xcode, but it still not work.

Thanks

回答1:

To turn off sandboxing go to Your target -> Capabilities -> App Sandbox (Turn the switch off)



回答2:

I solved this problem, it cause from Xcode sandbox mode, it work after turn off it.