【问题标题】:Unable to launch app via ADB i get "java.lang.SecurityException: Permission Denial: starting Intent" Exception无法通过 ADB 启动应用程序我得到“java.lang.SecurityException:权限拒绝:启动 Intent”异常
【发布时间】:2019-02-12 19:08:00
【问题描述】:

当我尝试通过 adb 启动应用程序时,我遇到了异常

java.lang.SecurityException: Permission Denial: 启动 Intent

使用的 CMD: adb shell am start -n pakage/mainactivity 名称

【问题讨论】:

    标签: adb appium


    【解决方案1】:

    确保您启动的活动具有正确的意图操作和类别。例如:

    <category android:name="android.intent.category.LAUNCHER" />
    <action android:name="android.intent.action.MAIN" />
    

    查看 android 文档了解更多信息:
    https://developer.android.com/guide/topics/manifest/manifest-intro
    https://developer.android.com/reference/android/content/Intent

    还有一个非常相似的问题,其中包含有关 android 清单的更多详细信息:
    Android - java.lang.SecurityException: Permission Denial: starting Intent

    【讨论】:

    • 我可以在有根设备中启动相同的应用程序,而在无根设备中我不能。
    • 只是为了添加到@PadmanabanGanapathy 的评论 - 如果你想要这个用于测试目的(即不想将android:exported="true" 添加到你AndroidManifest.xml,你需要运行adb root 然后adb shell am start -n pakage/mainactivity name
    猜你喜欢
    • 1970-01-01
    • 2013-06-05
    • 2013-11-18
    • 2020-03-29
    • 2019-06-27
    • 2016-06-28
    相关资源
    最近更新 更多