By Adam Karneboge on Thursday, 02 October 2014
Category: General

Running an application as root on OS X

Many administrators who use OS X have a good understanding of the command line interface and how to use it, and can often accomplish what they want to doing so. I for one, happen to be one of those. However there are times when using the CLI is just a bit more cumbersome than I'd prefer. A great example is manually editing a file that I don't have write access too. I am alright with vi as a command line text editor, but Text Edit, in plain text mode, is sometimes just more convenient. Unfortunately, while administrators can easily authenticate as, or obtain root access in the CLI, doing so in the GUI without enabling, and logging in as the root user is much more difficult. Thankfully, you can run an application as root by using a quick command in the terminal application.

Open the Terminal application. At the prompt, type the sudo command and then the path to the executable file inside an application's bundle. We'll use TextEdit for this example:

adam-mbp:~ akarneboge$ sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit

Open Activity Monitor and confirm that the user running TextEdit is now "root" instead of your own user, in my case, akarneboge.

You should be able to replace TextEdit with the name of any application you wish to do this with. Beware, however, that you are now running an application with elevated privileges where that user can make any system-wide change. This trick should not be common practice, and used only when necessary. It is certain to help you save time and frustration from time to time, however.

Leave Comments