5

There are command line flags (or "switches") that Chromium (and Chrome) accept in order to enable particular features or modify otherwise default functionality.

Chromium Command Line Switches

Run Chromium with flags

Tried Chrome 41.0.xx and Chromium 43.0.xxx shell with:

# echo "chrome <flags>" > /data/local/tmp/android-webview-command-line
# echo "chrome <flags>" > /data/local/tmp/content-shell-command-line
# echo "chrome --sync-url whatever" > /data/local/tmp/chrome-command-line

Want to add --sync-url flag to use my sync server instead of Google sync servers. chrome://flags only enable/disable flags but wont let you add new flag. Any idea how to run Chrome with flags on Android or directly add these into default profile?

  • Hey, if my answer has helped you, I'd appreciate it if you could "accept" it. This community only works if people who volunteer answers get something back :) – Munim Apr 2 '15 at 11:16
  • No luck, not reflected in chrome://sync-internals or chrome://version – Laam Alif Apr 12 '15 at 14:48
2

You need to add the entire command into the /data/local/tmp/chrome-command-line file. For example, I usually you want to skip the "First run experience", and I do:

# echo "chrome --disable-fre" > /data/local/tmp/chrome-command-line

You probably need

# echo "chrome --sync-url whatever" > /data/local/tmp/chrome-command-line

  • 1
    Seems the OP has updated his question without informing you that it's not working. – Andrew T. May 11 '15 at 1:10
  • @AndrewT. Yep.. I am pretty sure this is the correct way to set a command line switch in mobile chrome as I use it regularly. There must be some other reason the sync url is not being set. In any case, I think I answered the question asked. – Munim May 11 '15 at 8:31
  • 1
    Reading from other source, I found similar syntax for Chromium (different file, as already mentioned by OP), so I believe this answer should be correct. Perhaps the problem is the sync URL itself. – Andrew T. May 11 '15 at 8:34
1

I just went through this myself on Android 5.0.1. It's what was mentioned by Munim with two important tweaks.

  • in chrome::flags enable the enable commandline on non-rooted devices flag, this makes chrome look in /data/local/tmp/chrome-command-line (instead of /data/local/chrome-command-line)
  • create the chrome-command-line file with chrome plus the additional flags you want (no need to repeat existing flags found in about:version), e.g. chrome --sync-url whatever
  • change the mode of the chrome-command-line file to 755, e.g. chmod 755 chrome-command-line
  • restart chrome and verify that the flags you specified appear in about:version at the beginning

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.