Android - Trying to test a service on boot (java.lang.SecurityException: Permission Denial)

后端 未结 2 1128
栀梦
栀梦 2020-12-06 04:59

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 ..\\AppDa

相关标签:
2条回答
  • 2020-12-06 05:51

    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
    0 讨论(0)
  • 2020-12-06 05:53

    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
    
    0 讨论(0)
提交回复
热议问题