是否可以在模拟器上使用已发布的即时应用程序(BuzzFeed、Wish 等)?

Is it possible to use published instant apps(BuzzFeed, Wish, etc) on the emulator?

我在 this Google's tutorial.

之后的模拟器上 运行 一个 hello world 即时应用程序

一切正常,我收到一个对话框,要求获得启用即时应用程序的权限,然后单击“我加入”。之后,我还可以在设置 > Google > 即时应用程序中看到即时应用程序已启用。

但是当我打开浏览器时,运行 从已经发布了即时应用程序的网站(例如 BuzzFeed、NY Times Crossword 和 Wish)搜索并点击 links,它们就会打开常规网页。

我发现那些正在观看 Google IO 16 和 17 有关免安装应用程序的演示文稿的应用程序。我什至尝试了 link https://www.buzzfeed.com/tasty, featured on this keynote,但无济于事。

我怀疑这是因为 the current supported emulator 没有内置 Play 商店。

根据 this list,我也在一个不支持即时应用程序的国家(巴西)。但我不确定这是否会影响模拟器。

有谁知道这些是否确实是我无法查看已在 Play 商店上发布的免安装应用的原因?

由于 DAL 验证,我相信您不能为任意 link 安装即时应用程序。它应该是您拥有的域的 link。

https://developer.android.com/topic/instant-apps/getting-started/index.html#app_links

For instant apps, you must set the android:autoVerify attribute to true in all elements. This attribute tells Google to verify your app link with a Digital Assets Links (DAL) file that is hosted on your website and prevents apps from linking to domains that they do not own.

https://developer.android.com/topic/instant-apps/prepare.html#app-links

可能有两个原因。我建议按照指南 here 来设置您的模拟器。一旦您确认通过 adb shell pm list packages | grep "com.google.android.instantapps.supervisor" 成功启用免安装应用程序并在设置->Google->免安装应用程序中启用,然后尝试将 link 作为电子邮件发送到模拟器.

我发现在浏览器中单击 link 通常会让您停留在浏览器中。但是从 Gmail 打开 link 总是对我有用。不久前我刚刚检查过它是否适用于 Vimeo - https://vimeo.com/190063150.

由于巴西目前不在 Android 个支持 Instant Apps 的国家/地区列表中,因此此功能在真实设备上已关闭,但模拟器仍可用于 Instant Apps 开发和测试。

生产级应用程序,如 BuzzFeed,只能在该列表中的国家/地区通过即时应用程序启动:https://support.google.com/googleplay/android-developer/answer/7381861#production. In all other countries, Instant App URLs like https://www.buzzfeed.com/tasty 将继续访问该网站,无论您使用的是真实设备还是模拟器。