Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android skip chrome welcome screen using adb

Tags:

android

adb

I am trying to skip the chrome welcome screen when running tests. The problem is other solutions that I have found like this one don't seem to work anymore.

Commands used:

$ adb shell pm clear com.android.chrome 

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

$ adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
like image 332
Rgfvfk Iff Avatar asked Sep 01 '26 05:09

Rgfvfk Iff


2 Answers

The solution for me was actually a combination of the question and this answer. The solution can also be found in another question/answer, though it's not entirely clear.

The following should work:

$ adb shell am set-debug-app --persistent com.android.chrome 
$ adb shell 'echo "chrome --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line'
$ adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main

Some notes:

  1. In the Chromium project documentation, it's mentioned that for the command line file to be used, the user should

"Enable command line on non-rooted devices" in chrome://flags

Setting Chrome as the debug application replaces this requirement.

  1. In older device versions, the command line file was expected in /data/local. This folder is no longer writable from adb shell in non-rooted devices, so /data/local/tmp should be used instead. This is documented in this bug
  2. In the ChromeSwitches.java current source code, only --disable-fre still exists. The other flags might be required in older Chrome versions, but I didn't verify.
like image 124
Comnir Avatar answered Sep 02 '26 22:09

Comnir


What is your OS version? It is working on Android 10. You can try the below commands:

$ adb shell pm clear com.android.chrome 
$ adb shell am set-debug-app --persistent com.android.chrome
$ adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
like image 22
E S Pradeep Avatar answered Sep 02 '26 21:09

E S Pradeep



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!