I have to run some tests in an alpha version of an application. In these, I need to get a fresh install, navigate to some link and there, tap the 'Open in app button'.
For that to work, I previously need to set the app as default to open links from that site?
Since I need this to run in many different devices, executing the steps via UI interaction is not a good approach...
Is there any way that this can be done via adb commands?
What I am trying to do via adb commands is what manually you would do: Settings > Apps > AlphaVersion app > Set as default > Open supported links (enabled)
Use
adb shell pm get-app-link-owners [--user <USER_ID>] [--package <PACKAGE>] [<DOMAINS>]
To get which packages are responsible for opening the desired domain link along with their priority order. You can disable applications responsible for opening the link which are higher in the priority order, so that the desired domain is accessed only through the application, using :
adb shell pm disable-user [--user USER_ID] PACKAGE_OR_COMPONENT
Further, use :
adb shell pm set-app-links-allowed --user <USER_ID> [--package <PACKAGE>] <ALLOWED>
To turn the auto verified link handling of the desired domain and package to be true.
This however, doesn't automatically set your application as the default handler for the domain links, but one of the applications that handles the link on some of the ROMs.
For a permanent solution :