-
-
Notifications
You must be signed in to change notification settings - Fork 62
Tips
Tips and tricks useful for Android Web Browser developers.
Our example commands typically use Chrome package name: com.android.chrome.
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:com.android.chrome
adb shell pm disable-user --user 0 com.android.chrome.
adb shell pm enable com.android.chrome
adb shell am start -a android.settings.MANAGE_DEFAULT_APPS_SETTINGS
adb shell cmd package resolve-activity --brief -a android.intent.action.VIEW -d http://www.example.com
If no default available it will open the chooser:
adb shell am start -a android.intent.action.VIEW -d http://www.example.com
Some devices won't let you simply clear your default Browser application through settings. You should be able to clear it by running adb shell pm clear <package-name> where package-name is your current default browser. However that did not even work on HONOR Magic V2 for instance.
Here is my workaround using device UI:
- Set an app as default browser
- Open that app info settings
- Disable that app
The downside is that you can't use that browser unless you re-enable it. I'm usually doing that using Chrome com.android.chrome since I typically have Chrome beta installed and a bunch of other browsers I can use instead.