99

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?

Nakilon
  • 953
alex
  • 4,302

4 Answers4

122

This works with macOS:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --kiosk
Giacomo1968
  • 55,001
Andrew
  • 1,336
36

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
  • 461
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.

Arjan
  • 31,163
vynsynt
  • 111
  • 2
    It 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 Mar 07 '16 at 21:17
  • @vynsynt, Is the binbash line really needed? – Pacerier Dec 14 '17 at 04:16
6

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
  • 169
  • 1
  • 3
  • 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 Jul 02 '19 at 13:54
  • 9
    Hi @Marcin! If you know how, could you improve my response? – garciparedes Jul 02 '19 at 18:34
  • Good answer. Won't let me edit unless I put in at least 6 characters (to change "$1" to "$@" since you're using bash specifically here). Also probably best it's not in ~/.aliases really. An alias would be something like alias google-chrome='open -a "Google Chrome"' – Angelo Mar 24 '22 at 05:57