'Is it possible to pass an intent ... or intent extras ... to an Android app in the debugger?

I'm working on an activity that is designed to livestream a video to a given URL when started. It doesn't really have it's own user interface, to speak of. It is started by another android app, using an intent, and the url is passed to it in the intent.

So I'm running it in the debugger, and I have no idea how to pass the URL.

Of course I can just hardcode on while I'm debugging, but it seems hard to believe that with all the intents flying around under android, that it never occurred to anybody that you might want to debug what happens when your activity is started by some offbeat intent.

So have I missed something?



Solution 1:[1]

you can use ADB command to send a broadcast.

adb shell am start|startservice|broadcast <INTENT>[<COMPONENT>]
-a <ACTION> e.g. android.intent.action.VIEW
-c <CATEGORY> e.g. android.intent.category.LAUNCHER (start activity intent)

ref from link: https://www.automatetheplanet.com/adb-cheat-sheet/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alonso