This doesn't use adb, but the Automate app provided a script that can do this. It's activated by setting Automate as the voice assistant, and then activating the system voice assistant, and you get a popup with all the launch parameters for the foreground app, including extras.
You can also uses the App start block to write a custom capture method.