gpt4 book ai didi

android - 如何从 adb shell 命令启动 AFW 徽章应用程序?

转载 作者:行者123 更新时间:2023-12-04 16:16:26 32 4
gpt4 key购买 nike

enter image description here我无法从 Adb shell 命令启动 Android For work 启用的应用程序?有人可以举个例子吗?请参阅随附的屏幕,我想启动 Playstore 应用程序。没有徽章的 ICON Play 商店应用程序也与带徽章的 Play 商店应用程序具有相同的 Activity 信息(com.android.vending/com.google.android.finsky.activities.MainActivity)。而且我无法启动 Badge Play 商店 Activity 。请帮助我。

我尝试使用以下命令:adb shell am start com.android.vending/com.google.android.finsky.activities.MainActivity

它始终只启动非徽章 playstore 应用程序。

然后我按照 Google 的 AFW 博客进行了尝试: https://developer.android.com/work/managed-profiles.html

adb shell pm list users UserInfo{0:Drew:13} running UserInfo{10:Work profile:30} running

adb shell am start --user 10 -n "com.android.vending/com.google.android.finsky.activities.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

因此,我得到了 java.lang.SecurityException: Shell does not have permission to access user 10 错误。请有人帮助我。

最佳答案

我找到了启动应用程序的方法。使应用程序处于 Debug模式并添加配置客户端的 clearUserRestriction,如下所示。

dpm.clearUserRestriction(adminName,UserManager.DISALLOW_DEBUGGING_FEATURES

如果我们有这些更改,那么我可以使用以下命令启动 Android For Work 徽章应用程序。其中 --user 10 是 AFW 预配用户。

adb shell am start --user 10 -n "com.android.vending/com.google.android.finsky.activities.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

关于android - 如何从 adb shell 命令启动 AFW 徽章应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43722716/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com