Home > Software design >  What's the use of "-c android.intent.category.BROWSABLE" for "adb shell am start
What's the use of "-c android.intent.category.BROWSABLE" for "adb shell am start

Time:08-30

What's the different between

adb shell am start \
   -a android.intent.action.VIEW \
   -d https://www.airbnb.co.uk/rooms/48033927

and

adb shell am start \
   -a android.intent.action.VIEW \
   -c android.intent.category.BROWSABLE \
   -d https://www.airbnb.co.uk/rooms/48033927

Note: I know the use of -a android.intent.action.VIEW and without as per this How can I make ADB behave like real deeplink?, but can't find what's the different between using -c android.intent.category.BROWSABLE and not

CodePudding user response:

This is a category which the intent can have many and specified as

[-c <CATEGORY> [-c <CATEGORY>] ...]

see also https://developer.android.com/guide/topics/manifest/category-element

edit

If BROWSABLE the target activity allows itself to be started by a web browser to display data referenced by a link, such as an image or an e-mail message.

See https://developer.android.com/guide/components/intents-filters

CodePudding user response:

It might not make any difference, because -a is the action and -c is the category. When passing action VIEW and an URL, it is save to assume that this shall be BROWSABLE. Ultimately it all depends what the intent-filter in AndroidManifest.xml has declared. When passing a category like BROWSABLE, one still can choose alternate apps, while available - else it should be the default.

  • Related