Skip to content Skip to sidebar Skip to footer

Android - Trying To Test A Service On Boot (java.lang.SecurityException: Permission Denial)

I've been trying to test a service when a device boots up on android, but I cannot get it to work. I'm trying to start it with this command from CMD: (in ..\AppData\Local\Android\s

Solution 1:

I had same problem and solve by this:

 Try restarting ADB in root mode: adb root

and then broadcast BOOT_COMPLETED like this

 adb shell am broadcast -a android.intent.action.BOOT_COMPLETED 
-p yourpackage.app

Solution 2:

If adb root is not working (Production build), Use in your manifest :

android:name="android.intent.action.ACTION_BOOT_COMPLETED instead.

and from terminal:

adb shell am broadcast -a android.intent.action.ACTION_BOOT_COMPLETED

Post a Comment for "Android - Trying To Test A Service On Boot (java.lang.SecurityException: Permission Denial)"