0

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

Elye
  • 53,639
  • 54
  • 212
  • 474

2 Answers2

1

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

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • Thanks. But what difference does it make if one has BROWSABLE vs not having it through the ADB way of deeplink? – Elye Aug 29 '22 at 23:24
1

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.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
  • Thanks Martin. That's what I thought, there's no point supplying the "-c". But curious why Google in their example in https://developer.android.com/training/app-links/verify-site-associations#auto-verification, shows using "-c". – Elye Aug 29 '22 at 23:55
  • @Elye I think it should become more obvious, when leaving the action or even URL away... the `PackageManager` scans all `AndroidManifest.xml` intents... and the category indicates which to show in the corresponding selector GUI then. Eg. a web-browser would have a very unspecific URL filter, while otherwise it's filtered by the domain name. – Martin Zeitler Aug 30 '22 at 00:09