代码之家  ›  专栏  ›  技术社区  ›  Rapunzel Van Winkle

有可能在模拟设备上发现并运行第三方Android即时应用程序吗?

  •  14
  • Rapunzel Van Winkle  · 技术社区  · 7 年前

    like this )在我的模拟Nexus 5x(带Play Store)上,我相信我的开发环境配置正确。

    然而,我很想了解第三方应用程序的发现过程,并了解用户体验是什么样的。由于我自己没有合适的设备,我使用模拟的Chrome浏览器搜索启用即时应用程序的网站(如Stack Exchange)。但这些搜索只提供了常用的网站(而不是即时应用程序)。

    我读过 this post 应该 工作然而,这些答案似乎对我没有帮助。

    目前的情况有所不同,可能是因为我一直在尝试各种技巧使其发挥作用。(TLDR:我什么都没用。)

    • 在API 24模拟设备上,如果我键入 adb shell pm list packages grep "com.google.android.instantapps.supervisor" package:com.google.android.instantapps.supervisor 正如一个答案所示(但它仍然不起作用)。

    • API 24设备具有 Google Play services for Instant Apps (version 1.9-sdk-155682639)

    • URLs will be routed to Dev Manager in order to launch Instant Apps locally. Uninstall Dev Manager to disable Development Mode.

    • 在API 24设备上,设置->谷歌->Instant Apps,Instant Apps设置为true

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

    • 在API 26设备上, Google Play services for Instant Apps

    • 在API 26设备上,设置->谷歌没有列出即时应用程序(所以没有什么可设置的)

    以下是一些相关的额外细节:

    • 我的开发机器运行Windows 10 (非自愿)
    • 模拟设备是Nexus 5x(API 24和26),带有Play Store
    • 我在模拟设备上登录了一个真实的谷歌用户帐户。

    所以我的问题是:有没有可能在模拟设备上发现并打开第三方即时应用程序(如果有,如何实现)?

    2 回复  |  直到 7 年前
        1
  •  6
  •   dchai    7 年前

    目前,no.:(存在安全限制,阻止模拟设备使用各种谷歌服务。如果您查看日志,可能会发现类似“io.grpc.StatusException:INVALID_参数:Application credential header无效。请修复客户端以传递有效的Application credential header”的消息

    在API 26模拟设备上,如果我键入adb shell pm list packages grep“com.google.android.instantapps.supervisor”,则不返回任何结果

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

        2
  •  4
  •   Uddhav P. Gautam    7 年前

    启用时 安卓即时应用 从…起

    <activity
                android:name=".View.Activity.AboutActivity"
                android:parentActivityName="com.example1.uddhav.stopwatch.View.Activity.AboutActivity">
                <intent-filter android:autoVerify="true">
                    <action android:name="android.intent.action.VIEW" />
    
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="android.intent.category.BROWSABLE" />
    
                    <data
                        android:scheme="http"
                        android:host="your_web_address" />
                </intent-filter>
            </activity>
    

    因此,当你获得第三方应用程序时,你必须修改 AndroidManifest.xml 文件同上。

    而且,为了能够链接您的即时活动(例如AboutActivity),您必须保存生成的 assetlinks.json <your_web_site>/.well-known/assetlinks.json

    有一个反向工程工具,可以让您修改 文件

    uses-permission

    由于您没有处理AppLink意图,因此不需要

    // ATTENTION: This was auto-generated to handle app links.
    Intent appLinkIntent = getIntent();
    String appLinkAction = appLinkIntent.getAction();
    Uri appLinkData = appLinkIntent.getData();
    

    up to my understanding ,可以在支持的模拟器设备上运行第三方Android即时应用程序。如果我误解了你的问题,我道歉。