需要命令行才能使用adb启动Web浏览器

Shr*_*kar 77 android adb

如何使用该adb shell命令启动浏览器并使其打开某个网页?

Joa*_*org 181

运行此命令将在android中启动Web浏览器:

adb shell am start -a android.intent.action.VIEW -d http://www.stackoverflow.com
Run Code Online (Sandbox Code Playgroud)


小智 47

如果你的网址符号很重,你也应该积极引用

adb shell am start -a android.intent.action.VIEW -d 'http://stackoverflow.com/?uid=isme\&debug=true'
Run Code Online (Sandbox Code Playgroud)


aus*_*len 5

如果您想专门启动 Chrome

adb shell am start \
-n com.android.chrome/com.google.android.apps.chrome.Main \
-a android.intent.action.VIEW -d 'file:///sdcard/lazer.html'
Run Code Online (Sandbox Code Playgroud)

还可以通过以下方式让 Chrome 访问 sdcard

adb shell pm grant com.android.chrome android.permission.READ_EXTERNAL_STORAGE
Run Code Online (Sandbox Code Playgroud)

如果您使用的是 Chrome Canary 版本,请将 com.android.chrome 与 com.chrome.canary 交换。