18

We have a few repeating alarms setup and they work normally most of the time. Sometimes though they get stuck (probably canceled somehow). How to debug it to make sure an alarm is actually off when it seems stuck?

Regarding the reasons for the alarm to be cancelled: I'm aware it happens when the user force stops your app from Applications Manager. Can the system also randomly cancel it? (say when killing your whole app to reclaim resources?)

Victor Basso
  • 5,556
  • 5
  • 42
  • 60

1 Answers1

20

Regarding debugging the alarms:

adb shell dumpsys alarm

I still haven't figured out if alarms can be killed other than by a force stop by the user.

Victor Basso
  • 5,556
  • 5
  • 42
  • 60
  • 4
    To sort through and find relevant alarms, you can use grep/awk or Select-String. If you're on Terminal, you can use `adb shell dympsys alarm | grep "app.package.name"` and if you're on PowerShell you can use `adb shell dumpsys alarm | Select-String -Pattern "app.package.name"` – Advait Saravade Aug 15 '19 at 12:13
  • Fixed typo in command `adb shell dumpsys alarm | grep "app.package.name"` – Marvin Jul 02 '21 at 00:16