How can i run following command from objective using NSTask,
pluginkit -e ignore -i com.xxxxx.Plugin_Id
I tried this but not worked,
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/bin/sh"];
[task setArguments: @[@"pluginkit",@"-e",@"ignore",@"-i",@"com.xxxxx.Plugin_Id"]];
[task launch];
setLaunchPath
should be the binary you launching. pluginkit
is located on /usr/bin/
, so the launch code should be like this i think:
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/pluginkit"];
[task setArguments: @[@"-e", @"ignore", @"-i", @"com.company.pluginId"]];
[task launch];
[task waitUntilExit];
or with a single lined call:
system("pluginkit -e ignore -i com.company.pluginId");