【发布时间】:2019-02-12 19:08:00
【问题描述】:
当我尝试通过 adb 启动应用程序时,我遇到了异常
java.lang.SecurityException: Permission Denial: 启动 Intent
使用的 CMD: adb shell am start -n pakage/mainactivity 名称
【问题讨论】:
当我尝试通过 adb 启动应用程序时,我遇到了异常
java.lang.SecurityException: Permission Denial: 启动 Intent
使用的 CMD: adb shell am start -n pakage/mainactivity 名称
【问题讨论】:
确保您启动的活动具有正确的意图操作和类别。例如:
<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
【讨论】:
android:exported="true" 添加到你AndroidManifest.xml,你需要运行adb root 然后adb shell am start -n pakage/mainactivity name