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"
}
Share:
154,423

Related videos on Youtube

Kristen
Author by

Kristen

Updated on September 17, 2022

Comments

  • Kristen
    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
      Michael over 6 years
      @YumYumYum ugh! It's 2017 and none of the answers work (anymore?)!
  • Kristen
    Kristen almost 14 years
    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.
  • Andrew
    Andrew almost 14 years
    Ok. Can you try "ls /Applications/Google Chrome.app/Contents/MacOS" (or something like that) and post that?
  • Kristen
    Kristen almost 14 years
    @Andrew I ran ls /Applications/Google\ Chrome.app/Contents/MacOS and it printed 'Google Chrome' only. :S
  • Andrew
    Andrew almost 14 years
    Finished and edited answer. Try now.
  • Kristen
    Kristen almost 14 years
    @Andrew Thanks for that, and how would I run this on startup? Cheers.
  • vynsynt
    vynsynt over 8 years
    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.
  • Pacerier
    Pacerier over 6 years
    @vynsynt, Is the binbash line really needed?
  • user390303
    user390303 almost 5 years
    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.
  • garciparedes
    garciparedes almost 5 years
    Hi @Marcin! If you know how, could you improve my response? 🙂
  • Jarno Lamberg
    Jarno Lamberg over 3 years
    It does work for macOS Mojave 10.14.
  • Jarno Lamberg
    Jarno Lamberg over 3 years
    It does work for macOS Mojave 10.14.
  • Angelo
    Angelo over 2 years
    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"'