Retrieve (list of) default apps via ADB Many of you will know (or at least have heard of) commands like adb shell pm list packages or adb shell dumpsys package to retrieve a list of apps available on your device. What I am looking for and cannot find is a command to list default apps – like what is set as default launcher, default camera, default browser etc. Not even parsing the full details of all apps via e.g. for app in $(pm list packages); do [[ -n &quot;$(dumpsys package ${app#package:} | grep APP_BROWSER)&quot; ]] &amp;&amp; echo ${app#package:}; done reveals that (the command would simply list all web browsers on the device).
So how can I query for those default apps via ADB? It's fine if I have to pass the &quot;type&quot; (like APP_BROWSER in my example) as long as there's a reference of types available.
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:john@example.com
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 grep for packageName= (e.g. 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 &quot;always used&quot;), 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 resolve-activity with query-activities (note it might also return a one-liner like &quot;No activities found&quot;, especially on Android &lt; 8).
I call this a &quot;partly resolve&quot; 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 &lt; 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).