How to debug which AlarmManager alarms are running from your application?
Asked Answered
N

1

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?)

Neuritis answered 19/11, 2013 at 14:32 Comment(0)
N
21

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.

Neuritis answered 20/1, 2014 at 18:22 Comment(2)
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"Lot
Fixed typo in command adb shell dumpsys alarm | grep "app.package.name"Tradition

© 2022 - 2024 — McMap. All rights reserved.