Unable to launch app via ADB i get "java.lang.SecurityException: Permission Denial: starting Intent" Exception

Viewed 3138

While i try to launch app via adb i am getting below exception

java.lang.SecurityException: Permission Denial: starting Intent

CMD used : adb shell am start -n pakage/mainactivity name

1 Answers

Make sure that the activity you are launching has the right intent action and category. For example:

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

Check the android docs for more info:
https://developer.android.com/guide/topics/manifest/manifest-intro
https://developer.android.com/reference/android/content/Intent

There's also this very similar question with more details on android manifests:
Android - java.lang.SecurityException: Permission Denial: starting Intent

Related