Search code examples
androidandroid-studioandroid-intentadbmanifest

How to know what parameters can be passed through am for the particular apk with the given intent action


I will tell my problem with an example.
So if I want to open an android app page on google play store, I will send directly

adb shell am start -a android.intent.action.VIEW -d 'market://details?id=com.yourpackagename'

Here I want to know how the person should come to know that he needs to send the -d with that uri to open the android app page directly.

So here is my complete question-
With am there are many parameters that we can send like

am [start|instrument]

am start [-a <action>] [-d ]
[-t <mime_type>] [-c <category> [-c <category>] ...]
[-e <extra_key> <extra_value>
[-e <extra_key> <extra_value> ...]
[-n <component>] [-D] [<uri>]

How am I supposed to know what parameters can go with that apk intents?

Here is what I know?
I know what parameters can go with -n and -c options using the manifest of that apk but I don't know about -t,-e,-d options and even don't know where to look for that in manifest.


Solution

  • The mime-type should be specified in the Manifest, if it exists, as should the data scheme (not the data itself).

    However, to find which extras and which data the app is looking for, you need to look at the code and see how it's filtering the received Intent, and what it's looking for.