How to get additional functions of current activities through ADB

I have a question about using ADB.

I know this command:

adb shell dumpsys activity 

can show me all the actions that are currently being performed on the device.

But sometimes I notice that the intentions look like this:

 Intent { ...some_intent/activity_name.... (has extras) } 

I know that additional functions mean that the action was started with some parameters passed to it (maybe I'm wrong, please correct me if I find it).

So my question is: how can I get additional intent / activity functions through ADB?

The reason I need this is because I'm trying to run apk (installed on the phone) using the ADB command, for example:

 adb shell "su -c 'am start -n com.package.name/.ActivityName'" 

It works and brings up the application. The application has a start screen (for example, we call it HomeActivity), and you need to click on the button and make some selections (for example, SelectionActivity), and it will go to another screen (say, ActionActivity). I want to be able to run apk and make it jump directly to ActionActivity.

The first time you launch the ActionActivity application with the launch of the application, the crash will occur, I assume that this is due to the fact that this requires parameters on the SelectionActivity screen.

This is why I am trying to figure out what are the “advanced” or parameters that the ActionActivity screen actually has, so I can do something like:

 adb shell "su -c 'am start -n com.package.name/.ActionActivity -e param1 val1 -e param2 val2'" 

Hope my question is clear.

Please correct me if I make a mistake somewhere.

Thanks in advance!

+6
source share
1 answer

If I understand correctly, your goal is to start the action of the "action" with the correct intention, but you do not know what information about the parameters should be included, right?

The dumpsys command will not reset everything that you want, so to achieve the goal you have 2 options (you must find one device that you can write your own firmware into):

  • Change dump method in AMS to print additional information

  • Modify the source code for the ActivityThread class to print detailed intent information

+2
source

Source: https://habr.com/ru/post/952793/


All Articles