Steven Chou
Steven Chou

Reputation: 2215

"Operation not permitted" when execute shell script in mac app

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

Upvotes: 12

Views: 8646

Answers (3)

Steven Chou
Steven Chou

Reputation: 2215

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


Note, nowadays this is done in Build Settings:

enter image description here

Upvotes: 7

Marcel Derks
Marcel Derks

Reputation: 789

For me I had to go to Build Settings -> User Script Sandboxing -> false

Enable App Sandboxing is a different setting and was already set to false but has no impact on Run Scripts.

Upvotes: 22

mmmanishs
mmmanishs

Reputation: 681

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

Upvotes: 14

Related Questions