I need my application to perform a command while in the Sandbox. This is the code I have so far:
// Set up the task
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/bin/bash"];
NSArray *args = [NSArray arrayWithObjects:@"-l",
@"-c",
@"rm -rf .Trash/*",
nil];
[task setArguments: args];
// Set the output pipe.
NSPipe *outPipe = [[NSPipe alloc] init];
[task setStandardOutput:outPipe];
[task launch];
I get a log output of:
/bin/bash: /etc/profile: Operation not permitted
Any ideas?