Skipping "Welcome to Chrome"

5,829 views
Skip to first unread message

Eric Savoie

unread,
Oct 17, 2016, 11:15:43 PM10/17/16
to Chromium-dev
I'm trying to run some automated tests and the "Welcome to Chrome" pop up is being rather troublesome. I've attempted to add flags to skip it with adb shell --no-first-run and --disable-fre but neither of the flags actually got set.

My env is OS X running protractor with appium and an Android emulator. The tests run fine but I am finding myself unable to do anything but manually click the welcome modal. I've used at least one to two pages of suggestions on 10 hours of semi-creative googling. I'm hoping most answers are just outdated.

David Roger

unread,
Oct 18, 2016, 5:37:12 AM10/18/16
to ericsa...@gmail.com, Chromium-dev
These flags look fine. I checked in one of our scripts, and it uses:
--disable-fre --no-default-browser-check --no-first-run

There are instructions how to set command line flags on Android here:

If you need to do this in a python script, I think you can use FlagChanger:


On Tue, Oct 18, 2016 at 5:16 AM Eric Savoie <ericsa...@gmail.com> wrote:
I'm trying to run some automated tests and the "Welcome to Chrome" pop up is being rather troublesome. I've attempted to add flags to skip it with adb shell --no-first-run and --disable-fre but neither of the flags actually got set.

My env is OS X running protractor with appium and an Android emulator. The tests run fine but I am finding myself unable to do anything but manually click the welcome modal. I've used at least one to two pages of suggestions on 10 hours of semi-creative googling. I'm hoping most answers are just outdated.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-dev

Eric Savoie

unread,
Oct 18, 2016, 9:10:44 AM10/18/16
to Chromium-dev

Looks like it was already running as root... the mystery deepens. 

Can't seem to make it work :(

PhistucK

unread,
Oct 18, 2016, 9:55:44 AM10/18/16
to ericsa...@gmail.com, Chromium-dev
Hmm are you running Content Shell or Android WebView?
If not, you want to use instead (or in addition) -
/data/local/tmp/chrome-command-line
/data/local/chrome-command-line



PhistucK

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Eric Savoie

unread,
Oct 18, 2016, 11:16:54 AM10/18/16
to Chromium-dev, ericsa...@gmail.com

I downgraded my AVD to Marshmellow (6.0) and I got an interesting line that I wasn't getting with 7.0. Additionally it looks like 7.0 is extremely hard to get root access on. 

[100%] /data/local/tmp/com.android.chrome_53.0.2785.124-278512411_minAPI21x86nodpi_apkmirror.com.apk

pkg: /data/local/tmp/com.android.chrome_53.0.2785.124-278512411_minAPI21x86nodpi_apkmirror.com.apk

Is the message I got from I added chrome to my Galaxy Nexus with Android 6.0. 

However the adb shell commands did not work. 

How do I check which one I am supposed to be using? I tried all three. 



PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Eric Savoie

unread,
Oct 18, 2016, 11:20:31 AM10/18/16
to Chromium-dev, ericsa...@gmail.com

Well great news. I don't know what did it but the welcome screen has gone away using Galaxy Nexus 6 with nothing else changed. Maybe the "chromeOptions" in protractor are incompatible with 6+. Thanks for the help guys. 

Ilya

unread,
Apr 5, 2017, 7:42:18 PM4/5/17
to Chromium-dev, ericsa...@gmail.com
In case this helps someone else, I was trying to change the command line to no avail in Android 7.1.1

After running with -show-kernel -verbose, it turned out that the selinux was preventing chrome from reading from /data/local/chrome-command-line
It worked after running with "-selinux disabled"

I was able to finally launch Chrome with a custom command line by using:

adb shell 'echo "chrome --no-default-browser-check --no-first-run --disable-fre" > /data/local/chrome-command-line'

adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main -d "$URL"

after running the emulator with "emulator ... -selinux disabled"

Hope this helps someone else trying to do this!

Torne (Richard Coles)

unread,
Apr 5, 2017, 8:18:46 PM4/5/17
to ikre...@gmail.com, Chromium-dev, ericsa...@gmail.com

You should write the command line to /data/local/tmp instead which isn't blocked by selinux. There's a bug open about switching this over completely in all scripts and docs but we haven't quite sorted it yet.


Ilya Kreymer

unread,
Apr 5, 2017, 8:33:42 PM4/5/17
to Torne (Richard Coles), Chromium-dev, ericsa...@gmail.com
I tried writing to both paths initially, but looks like the /tmp path is currently only used if Chrome is the debug app:

I don't actually want to debug Chrome, just launch it. But perhaps it should always check the /tmp path first, even when its not the debug app?


Torne (Richard Coles)

unread,
Apr 6, 2017, 11:54:24 AM4/6/17
to Ilya Kreymer, Chromium-dev, ericsa...@gmail.com
That's a very old version of the code you linked to; it's from over two years ago. The current version has for some time checked /data/local/tmp on all debug builds of the OS regardless of the debug app setting. So, if you have a userdebug/eng build of Android it should work fine. If you have a user build, then it does still need to be set as the debug application and this is intentional; the command line file is only intended to be used for dev/test/debug purposes.

Baurzhan

unread,
Apr 25, 2017, 12:10:56 AM4/25/17
to Chromium-dev
String context = driver.getContext(); // = "CHROMIUM"
driver.context("NATIVE_APP");
driver.findElement(By.id("com.android.chrome:id/terms_accept")).click();
driver.findElement(By.id("com.android.chrome:id/negative_button")).click();
driver.context(context);

Bill Hileman

unread,
Nov 30, 2018, 12:43:05 PM11/30/18
to Chromium-dev, baurz...@gmail.com
I realize this is an old post, but your code helped me get over a hump.

The only thing I added to my version was to avoid any error if the alerts were not present by checking for their existence first:

    String context = driver.getContext(); // = "CHROMIUM"
    driver.context("NATIVE_APP");
    if (!driver.findElements(By.id("com.android.chrome:id/terms_accept")).isEmpty()) {
    driver.findElement(By.id("com.android.chrome:id/terms_accept")).click();
    if (!driver.findElements(By.id("com.android.chrome:id/negative_button")).isEmpty())
    driver.findElement(By.id("com.android.chrome:id/negative_button")).click();
    }
    driver.context(context);


Reply all
Reply to author
Forward
0 new messages