How can I start a browser with the adb shell
command and make it open a certain web page?
Asked
Active
Viewed 1e+01k times
110

Alex P.
- 30,437
- 17
- 118
- 169

Shrikant Tudavekar
- 1,399
- 3
- 11
- 6
-
Not sure what you mean, do you mean start a browser intent? – BeRecursive Aug 18 '10 at 13:14
-
any app from CLI: https://stackoverflow.com/questions/4567904/how-to-start-an-application-using-android-adb-tools – Ciro Santilli OurBigBook.com Nov 07 '17 at 10:55
6 Answers
265
Running this command will start a web browser in android:
adb shell am start -a android.intent.action.VIEW -d http://www.stackoverflow.com

RzR
- 3,068
- 29
- 26

Joakim Lundborg
- 10,920
- 6
- 32
- 39
-
I am trying to use this to load pre saved pages(on sdcard), but it gives error. – shingaridavesh Jun 19 '15 at 22:19
-
This was opening a new tab each time I fired it, resulting in a great mess of opened tabs after a while. – Bobbi Bennett Jan 22 '16 at 21:01
-
actually you need to remove "./" before executing that command. – Irwin Nawrocki Jan 15 '19 at 10:49
60
If your url's are symbol heavy you should also quote aggressively
adb shell am start -a android.intent.action.VIEW -d 'http://stackoverflow.com/?uid=isme\&debug=true'

Daniel Imms
- 47,944
- 19
- 150
- 166

ash_jungroup
- 659
- 5
- 3
6
If you want to start Chrome specifically
adb shell am start \
-n com.android.chrome/com.google.android.apps.chrome.Main \
-a android.intent.action.VIEW -d 'file:///sdcard/lazer.html'
Also give Chrome access to sdcard via
adb shell pm grant com.android.chrome android.permission.READ_EXTERNAL_STORAGE
Swap com.android.chrome with com.chrome.canary if you are using Chrome canary version.

auselen
- 27,577
- 7
- 73
- 114
4
I wanted to start silk on my kindle via adb, without adding a new url. I came up with this:
adb shell am start -n com.amazon.cloud9/.browsing.BrowserActivity

Daniel Imms
- 47,944
- 19
- 150
- 166

Bobbi Bennett
- 1,636
- 1
- 11
- 13
0
You can open the default web browser with keyevents too (it's possible to write KEYCODE_EXPLORER instead of 64)
adb shell input keyevent 64
Enter an url submit: (66 -> KEYCODE_ENTER)
adb shell input text "stackoverflow.com" && adb shell input keyevent 66

kubano
- 633
- 7
- 10
0
I add --user 0
after start and work in jackpal emulator like this:
adb shell am start --user 0 -a android.intent.action.VIEW -d http://www.stackoverflow.com

Stephen Ostermiller
- 23,933
- 14
- 88
- 109