Open Chrome from terminal with developer console open

11,455

Solution 1

The flag you're looking for is --auto-open-devtools-for-tabs. Please note, that you should quit Chrome before this setting will take effect.

This has worked at least since Chrome 55.0.2883.87 m (the latest version as of initial post)

Solution 2

A Google employee maintains this list of automatically updated Chromium flags. There doesn't seem to be a flag for opening Chrome with developer console open.

Solution 3

What exactly are you trying to achieve by that? If you are trying to run some kind of automated tests, you should try out PhantomJS.

Solution 4

Seems there is no such option. I added a feature request in Chrome product forum https://productforums.google.com/forum/#!category-topic/chrome/give-feature-feedback-and-suggestions/mac/Stable/3HYIAl8_ndc

Share:
11,455

Related videos on Youtube

Maros
Author by

Maros

Updated on June 03, 2022

Comments

  • Maros
    Maros about 2 years

    I can run Google Chrome from the command line using $ google-chrome, but what flag can I pass to open it with developer console already open, preferably open to the console tab?

    I checked the man page for google-chrome but it states that

    Google Chrome has hundreds of undocumented command-line flags that are added and removed at the whim of the developers.

    I'm hoping one of those undocumented flags does what I want.

  • statox
    statox over 7 years
    You should change your accepted answer to @Dethariel's one it works on newer versions of chrome.
  • shinzou
    shinzou about 7 years
    uh no it doesn't work, it starts chrome normally without the dev tools open.
  • Dethariel
    Dethariel about 7 years
    @kuhaku this worked for everybody I spoke with so far. Are you sure you're spinning up chrome correctly?
  • toad
    toad almost 7 years
    It does work. You just need to flag '--args' and then '--auto-open-devtools-for-tabs'. Also make sure you quit Chrome before running the command.
  • Nacho Coloma
    Nacho Coloma almost 7 years
    This argument will open devtools on every new tab, not just the requested page, and you need to exit Chrome before running the command.
  • Brian Hannay
    Brian Hannay over 6 years
    Didn't work for me, but I didn't close Chrome beforehand.