Open Chrome with ADB

老子叫甜甜 提交于 2021-02-07 03:07:44

问题


I used to able to launch Chrome using ADB like this:

adb shell am start -n com.android.chrome/com.android.chrome.Main

But now when I try it, I get:

Starting: Intent { cmp=com.android.chrome/.Main }
Error type 3
Error: Activity class {com.android.chrome/com.android.chrome.Main} does not exist.

It seems that the Main Class name has changed. If so, what's the new one?


回答1:


Adb command for this

adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main



回答2:


To open the default page of Chrome with ADB you can use:

adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main

Instead, to open an url directly you can use:

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


来源:https://stackoverflow.com/questions/28150650/open-chrome-with-adb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!