Start Google Chrome on Mac with command line switches

79

28

I've read you can start Google Chrome in kiosk mode in Windows by using the argument --kiosk.

I know how to do this on Windows, but how can I do this on Mac OS X?

And how can I run Google Chrome with the --kiosk argument on startup?

alex

Posted 2010-06-27T23:41:00.827

Reputation: 3 604

@YumYumYum ugh! It's 2017 and none of the answers work (anymore?)! – Michael – 2018-01-19T23:53:14.747

Answers

95

This works with macOS:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --kiosk

Andrew

Posted 2010-06-27T23:41:00.827

Reputation: 1 066

4DOES NOT WORK on OSX – YumYumYum – 2016-03-02T08:32:56.530

You mean the argument doesn't work? The actual process of full screening Chrome is in the Mac version. Any hack to send a Cmd+Shift+F to get it to full screen? Thanks for your answer. – alex – 2010-06-27T23:52:21.737

Ok. Can you try "ls /Applications/Google Chrome.app/Contents/MacOS" (or something like that) and post that? – Andrew – 2010-06-27T23:58:07.527

@Andrew I ran ls /Applications/Google\ Chrome.app/Contents/MacOS and it printed 'Google Chrome' only. :S – alex – 2010-06-28T00:18:28.693

Finished and edited answer. Try now. – Andrew – 2010-06-28T22:27:17.557

1@Andrew Thanks for that, and how would I run this on startup? Cheers. – alex – 2010-07-01T13:23:33.223

30

It is probably even better to use the open command (in case the application is not located in the Application folder). E.g.: open -a "Google Chrome" --args --kiosk http://www.example.com

wuxscho

Posted 2010-06-27T23:41:00.827

Reputation: 401

7DOES NOT WORK on OSX – YumYumYum – 2016-03-02T08:32:46.653

11

In AppleScript, paste the following text:

do shell script "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --kiosk"

Save it as an application and add it to your startup items.

vynsynt

Posted 2010-06-27T23:41:00.827

Reputation: 111

4DOES NOT WORK on OSX – YumYumYum – 2016-03-02T08:32:50.357

2It did back in 2012. Now, use the code that newer comments have mentioned, /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --kiosk --app=http://domain.com put that in a plain txt document, but add the following snippet above the call to Chrome to make it executable,#!/bin/bash and add it to your startup items, or doublbe click to launch. – vynsynt – 2016-03-07T21:17:39.760

@vynsynt, Is the binbash line really needed? – Pacerier – 2017-12-14T04:16:41.667

3

You can create an alias to open websites or files via command line. To do this, you can include at the end of your ~/.bashrc, ~/.bash_profile or ~/.aliases the following lines:

# Google Chrome Alias
google-chrome() {
    open -a "Google Chrome" "$1"
}

garciparedes

Posted 2010-06-27T23:41:00.827

Reputation: 139

This is not how you deal with spaces in filenames. Learn to quote or escape special chars properly. Also, "$1" is not going to work right when you have more than one param to pass, especially if those params themselves have unquoted values. – Marcin – 2019-07-02T13:54:57.360

1Hi @Marcin! If you know how, could you improve my response? – garciparedes – 2019-07-02T18:34:27.317