osx - Shell Script from Objective c -
how can run following command objective using nstask,
pluginkit -e ignore -i com.xxxxx.plugin_id
i tried 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 binary launching. pluginkit
located on /usr/bin/
, launch code should think:
nstask *task = [[nstask alloc] init]; [task setlaunchpath:@"/usr/bin/pluginkit"]; [task setarguments: @[@"-e", @"ignore", @"-i", @"com.company.pluginid"]]; [task launch]; [task waituntilexit];
or single lined call:
system("pluginkit -e ignore -i com.company.pluginid");
Comments
Post a Comment