Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
How do I pass command line arguments to Dock items?

On a Windows PC, if I need to provide any launch options to an application (say, Chrome browser), I can do that by creating a shortcut to Chrome.exe and adding the options to the end of the shortcut's Target property.

How can I do the same thing on a Mac? Specifically I need to pass some launch options to my Firefox/Chrome browser. I'm running Mac OS X 10.7.3.

share|improve this question

marked as duplicate by Doug Harris, Canadian Luke, 8088, Olli, Diogo Aug 28 '12 at 20:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

In Unix systems (of which OS X is one), options to programs are given at the command line, normally preceeded by "-". So, to run firefox with, for example a private session, open a terminal and enter:

 $ firefox -private

If you want to make this the default, every time you run firefox, you can create a BASH alias. Edit the file .bashrc in your user's home directory and add this line:

`alias firefox="firefox -private"`

Once you save that file, everytime you run firefox you will run it with the desired options.

Finally, to get a list of the command line options available to firefox, run firefox -h from a terminal. The following is the output on Linux:

$ firefox -h
Usage: firefox [ options ... ] [URL]
       where options include:

X11 options
  --display=DISPLAY  X display to use
  --sync             Make X calls synchronous
  --g-fatal-warnings Make all warnings fatal

Firefox options
  -h or -help        Print this message.
  -v or -version     Print Firefox version.
  -P <profile>       Start with <profile>.
  -migration         Start with migration wizard.
  -ProfileManager    Start with ProfileManager.
  -no-remote         Do not accept or send remote commands; implies -new-instance.
  -new-instance      Open new instance, not a new window in running instance.
  -UILocale <locale> Start with <locale> resources as UI Locale.
  -safe-mode         Disables extensions and themes for this session.
  -jsconsole         Open the Error console.
  -browser           Open a browser window.
  -new-window  <url> Open <url> in a new window.
  -new-tab     <url> Open <url> in a new tab.
  -preferences       Open Preferences dialog.
  -search     <term> Search <term> with your default search engine.
  -private           Enable private browsing mode.
  -private-toggle    Toggle private browsing mode.
  -setDefaultBrowser Set this app as the default browser.
share|improve this answer

From the command line, you can use the following:

open -a ProgramName --args your program arguments

Since OS X applications are packages as application bundle and their binaries aren't usually on the $PATH, the usual "Unix way" of launching applications is usually too complicated unless you're willing to alias or ln -s everything. Compare (if you installed Firefox to the default applications folder):

open -a Firefox
/Applications/Firefox.app/Contents/MacOS/firefox

For passing command-line options as arguments without opening Terminal, see this post.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.