I'm using Chrome version 74.0.3729.136. My phone is not rooted. I'm trying to use flags in Chrome command line without root.

I use the guide from Run Chromium with flags. According to that guide, with flags, it can be done.

The guide said:

For production build on a non-rooted device, you need to enable "Enable command line on non-rooted devices" in chrome://flags, then set command-line in /data/local/tmp/chrome-command-line. When doing that, mind that the first command-line item should be a "_" (underscore) followed by the ones you actually need. Finally, manually restart Chrome ...

I successfully set up the flag "Enable command line on non-rooted devices". But then I need to copy the data file to /data/local/tmp/chrome-command-line - and I cannot do that.

I tried:

  1. Command like that:

    C*:\WINDOWS\system32>adb shell 'echo --unsafely-treat-insecure-origin-as-secure=TestTest > /data/local/tmp/chrome-command-line'*
    The system cannot find the path specified.
  2. Recommendation from Run Google Chrome with flags (not from chrome://flags)

    # echo "chrome --sync-url whatever" > /data/local/tmp/chrome-command-line
  3. Use different Android OS (5-7).

  4. Use construction like the following for copying files:

    run-as com.example.app "cat /sdcard/temp_prefs.xml > shared_prefs/com.example.app_preferences.xml"

but nothing happened.

Anyone has tried it?

1 Answer 1


It worked. You need to set the flag and next, from the command line:

adb shell

shell@:/ $ echo "chrome --user-agent=MyUser" > /data/local/tmp/chrome-command-line

To confirm it, you can download the file from the phone

adb pull /data/local/tmp/chrome-command-line C:\

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .