You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在开启工作资料的安卓设备上用adb启动Intent遇权限问题求助

解决ADB启动工作资料用户Intent的权限问题

针对你遇到的SecurityException: Shell does not have permission to access user 11错误,可尝试以下几种方案:

  • 切换到目标用户执行命令
    先通过su切换到工作资料用户的上下文,再启动Intent:

    # 方法1:分步执行
    adb shell su --user 11
    am start -W -a android.intent.action.VIEW -d "https://www.myapp.com/link" com.myapp
    
    # 方法2:单条命令执行
    adb shell su --user 11 am start -W -a android.intent.action.VIEW -d "https://www.myapp.com/link" com.myapp
    

    注:部分设备需要Root权限才能使用su --user切换用户。

  • 使用--profile参数指定工作配置文件
    工作资料属于主用户的关联配置文件,可先通过adb shell pm list profiles获取配置文件ID,再用--profile参数指定:

    # 假设主用户ID为0,工作资料配置文件ID为10
    adb shell am start --profile 0:10 -W -a android.intent.action.VIEW -d "https://www.myapp.com/link" com.myapp
    
  • 检查设备权限限制
    如果是企业管控设备,可能存在ADB跨用户操作的限制,需要联系设备管理员开放权限,或在设备开发者选项中确认ADB的权限设置是否允许跨用户访问。

内容的提问来源于stack exchange,提问作者Subodh Nijsure

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 15:40:24