Skip to content

Instantly share code, notes, and snippets.

@mashhoodr
Last active December 29, 2015 21:19
Show Gist options
  • Save mashhoodr/7729661 to your computer and use it in GitHub Desktop.
Save mashhoodr/7729661 to your computer and use it in GitHub Desktop.
A hack to do something with Administrator privileges in Cocoa. This saves you from implementing the fairly complicated route of getting the administrative right using BetterAuthorizationSample example
NSDictionary *error = [NSDictionary dictionary];
NSAppleScript *run = [[NSAppleScript alloc]
initWithSource:@"do shell script "gem install calabash-cucumber;" with administrator privileges"];
[run executeAndReturnError:&error];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment