I meanwhile found a partly resolve working with Android 7/8 and up (when the
cmd package command was added):
- Default dialer:
cmd package resolve-activity tel://123456
- Default mail:
cmd package resolve-activity mailto:[email protected]
- Default browser:
cmd package resolve-activity http://www.example.com/
- Default messenging:
cmd package resolve-activity sms://123456
- Default homescreen launcher:
cmd package resolve-activity -c android.intent.category.HOME -a android.intent.action.MAIN
In the output, then
packageName=com.android.messaging for the default SMS app). If a given action has no default set (e.g. multiple browsers are installed but none was declared to be "always used"), the action will resolve to the OS (
packageName=android) to prompt the user. Side-note: if you want to check for available alternatives, just replace
query-activities (note it might also return a one-liner like "No activities found", especially on Android < 8).
I call this a "partly resolve" as it lacks several default apps I've no idea what activity to ask for – like the
default homescreen launcher (note: just figured) or the assistant app (hints welcome!).
Thanks to Irfan Latif for pointing out a solution for Android 10 and up. Here, the role manager was added which I had already found but didn't figure how to call it via ADB. Turns out that was because all my devices are running Android < 10 (and as just said, role manager was added with Android 10), and the command would be
dumpsys role (but not availabe before Android 10).