Start Google Chrome on Mac with command line switches
154,423
Solution 1
This works with macOS:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --kiosk
Solution 2
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
Solution 3
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.
Solution 4
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"
}
Related videos on Youtube
Author by
Kristen
Updated on September 17, 2022Comments
-
Kristen almost 2 years
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?-
Michael over 6 years@YumYumYum ugh! It's 2017 and none of the answers work (anymore?)!
-
-
Kristen almost 14 yearsYou 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.
-
Andrew almost 14 yearsOk. Can you try "ls /Applications/Google Chrome.app/Contents/MacOS" (or something like that) and post that?
-
Kristen almost 14 years@Andrew I ran
ls /Applications/Google\ Chrome.app/Contents/MacOS
and it printed 'Google Chrome' only. :S -
Andrew almost 14 yearsFinished and edited answer. Try now.
-
Kristen almost 14 years@Andrew Thanks for that, and how would I run this on startup? Cheers.
-
vynsynt over 8 yearsIt 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. -
Pacerier over 6 years@vynsynt, Is the binbash line really needed?
-
user390303 almost 5 yearsThis 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. -
garciparedes almost 5 yearsHi @Marcin! If you know how, could you improve my response? 🙂
-
Jarno Lamberg over 3 yearsIt does work for macOS Mojave 10.14.
-
Jarno Lamberg over 3 yearsIt does work for macOS Mojave 10.14.
-
Angelo over 2 yearsGood 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 likealias google-chrome='open -a "Google Chrome"'