I am working on mac application in which I am doing some stuff with root privilege and that is working fine and now I want to delete that Helper Tools so I am trying to delete that helper tool using the NSTask below is the code.
NSTask *task = [[NSTask alloc] init];
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Uninstall" ofType:@"sh"];
[task setLaunchPath:bundlePath];
[task setArguments:[NSArray arrayWithObjects:@"Uninstall.sh", nil]];
[task setStandardOutput:[NSPipe pipe]];
[task setStandardInput:[NSPipe pipe]];
[task launch];
It will prompt user password but then it says permission denied.
Below is the code I use to delete the helper tool from mac with admin privileges.
In fullScript write your terminal command and try.
Hope this will help you.