是否可以在模拟设备上发现并运行第三方Android Instant Apps? [英] Is it possible to discover and run third-party Android Instant Apps on an emulated device?

查看:100
本文介绍了是否可以在模拟设备上发现并运行第三方Android Instant Apps?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试了解Android即时应用.由于我不拥有任何支持它们的真实设备,因此我正在使用模拟器(来自Android Studio 3.0 Canary 9).我可以成功运行玩具"即时应用程序( )(在Play商店中)上模拟的Nexus 5x上,因此我认为我的开发环境已正确配置.

I'm currently trying to learn about Android instant apps. Since I don't own any real devices that support them, I'm using the emulator (from Android Studio 3.0 Canary 9). I can successfully run "toy" instant apps (like this) on my emulated Nexus 5x (with Play Store), so I believe that my development environment is configured correctly.

但是,我很好奇要了解第三方应用程序的发现过程,并了解用户体验是什么样的.缺少适合自己的设备,我使用了模拟的Chrome浏览器来搜索启用了即时应用程序的网站(例如Stack Exchange).但是这些搜索只给了我常用的网站(不是即时应用程序).

However, I was curious to learn about the discovery process for third-party apps, and find out what the user experience is like. Lacking a suitable device of my own, I used the emulated Chrome browser to search for sites (like Stack Exchange) that have instant apps enabled. But these searches only give me the usual websites (not instant apps).

我阅读了此内容引起了极大的兴趣,因为这似乎表明该应该有效.但是,这些答案似乎并没有帮助我.

I read this post with great interest, because it seems to suggest that this should work. However, those answers didn't seem to help me.

  • 我在澳大利亚,应该是其中一个国家/地区支持即时应用.
  • 按照一个答案中的建议,我尝试过发送应在电子邮件中的即时应用程序中打开的链接,然后单击它们,但它仍然只是将我发送到浏览器链接.
  • 有关DAL验证的答案很有趣,但是似乎不应该在浏览器中打开链接时应用它?

API 24和API 26模拟设备(均包括Play商店) 目前处于有些不同的情况,可能是因为我一直在尝试各种技巧来使其工作. (TLDR:没什么对我有用.)

The API 24 and API 26 emulated devices (both of which include the Play Store) are currently in somewhat different conditions, probably because I've been trying all sorts of tricks to make it work. (TLDR: Nothing's working for me.)

  • 在API 24仿真的设备上,如果我键入adb shell pm list packages grep "com.google.android.instantapps.supervisor",则它会输出package:com.google.android.instantapps.supervisor,这是一个答案所建议的(但它仍然不起作用).

  • On the API 24 emulated device, if I type adb shell pm list packages grep "com.google.android.instantapps.supervisor" then it outputs package:com.google.android.instantapps.supervisor as one answer suggests (but it still doesn't work).

API 24设备已安装Google Play services for Instant Apps (version 1.9-sdk-155682639).

The API 24 device has Google Play services for Instant Apps (version 1.9-sdk-155682639) installed.

API 24设备在屏幕顶部有一个闪电"通知,显示开发模式处于活动状态":URLs will be routed to Dev Manager in order to launch Instant Apps locally. Uninstall Dev Manager to disable Development Mode.

The API 24 device has a "lightning bolt" notification at the top of the screen saying "Development Mode Active": URLs will be routed to Dev Manager in order to launch Instant Apps locally. Uninstall Dev Manager to disable Development Mode.

在API 24设备上,设置-> Google->即时应用程序,即时应用程序设置为true

On the API 24 device, Settings -> Google -> Instant Apps, instant apps is set to true

在API 26仿真设备上,如果键入adb shell pm list packages grep "com.google.android.instantapps.supervisor"则不返回任何内容

On the API 26 emulated device, if I type adb shell pm list packages grep "com.google.android.instantapps.supervisor" returns nothing

在API 26设备上,未安装Google Play services for Instant Apps,并且也没有任何闪电"通知

On the API 26 device, Google Play services for Instant Apps isn't installed, and there isn't any "lightning bolt" notification either

在API 26设备上,设置-> Google不会列出即时应用程序(因此没有任何设置)

On the API 26 device, Settings -> Google doesn't list Instant Apps (so there's nothing to set)

以下是一些其他详细信息,如果它们是相关的:

Here are some additional details, in case they're relevant:

  • 我的开发计算机运行Windows 10 (并非选择)
  • 模拟的设备是具有Play商店的Nexus 5x(API 24和26)
  • 我也尝试了"x86"图像,因为有人建议将它们用于Windows,但它们也不起作用. (这可能是因为Play商店没有随附"x86"图像,我认为这是Instant Apps所必需的?)
  • 我已在仿真设备上登录了真实的Google用户帐户.

有了我现在设置的开发环境,我可以继续开发自己的即时应用程序,将其部署在自己的仿真设备上并进行测试.我真的只是很好奇,看看其他人的即时应用程序是如何工作的.另一个帖子(上面有链接)建议我应该可以做到这一点.

With the development environment I've set up now, I can continue to develop my own instant app, deploy it on my own emulated devices, and test it. I was really just curious to see how other people's instant apps work. And another post (linked above) suggested that I should be able to do this.

所以这是我的问题:是否可以在模拟设备上发现并打开第三方Instant Apps(如果可以,如何打开)?

So here's my question: Is it possible to discover and open third-party Instant Apps on an emulated device (and if so, how)?

推荐答案

是否可以在仿真设备上发现并打开第三方Instant Apps(如果可以,如何打开)?

Is it possible to discover and open third-party Instant Apps on an emulated device (and if so, how)?

目前,没有. :(已有安全限制,阻止模拟设备使用各种Google服务.如果您查看日志,可能会发现类似于"io.grpc.StatusException:INVALID_ARGUMENT:应用程序凭据标头无效的消息.请将该客户端固定为传递有效的应用程序凭证标头."

At present, no. :( There are security restrictions in place preventing emulated devices from using various Google services. If you check the log, you might find a message similar to "io.grpc.StatusException: INVALID_ARGUMENT: Application credential header not valid. Please fix the client to pass a valid application credential header."

在API 26模拟设备上,如果我键入adb shell pm列表包,则grep"com.google.android.instantapps.supervisor"不会返回任何内容

On the API 26 emulated device, if I type adb shell pm list packages grep "com.google.android.instantapps.supervisor" returns nothing

仅供参考,Supervisor不适用于Android O.

FYI, Supervisor isn't used for Android O.

这篇关于是否可以在模拟设备上发现并运行第三方Android Instant Apps?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆